home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / autcs101.zip / AUTOCIS.WAS < prev    next >
Text File  |  1992-12-09  |  94KB  |  3,087 lines

  1. ;AUTOCIS.WAS - automated CIS script for Prowin
  2.  
  3. ; Reduced capability script, awaiting compiler improvement
  4.  
  5. ; ****************************************************************************
  6. ; *  This is a script for Procomm for Windows that automates the uploadind   *
  7. ; *  and downloading of Mail, Forum messages and Library files.  Activities  *
  8. ; *  in other areas of CompuServe are also automated.  Task definition and   *
  9. ; *  message/letter writing and review is accomplished off-line without CIS  *
  10. ; *  charges and on-line operation is totally automated.                     *
  11. ; ****************************************************************************
  12.  
  13. ;                   Last update  26 November 1992
  14.  
  15. #define Forum1 "P&ractice"             ; menu descriptions
  16. #define Forum2 "&DataStorm"
  17. #define Forum3 "&PPI Forum"
  18. #define Forum4 "&Compaq Forum"
  19. #define Forum5 "&MECA"
  20. #define Forum6 "&Norton Utilities"
  21. #define Forum7 "&IBM Communications"
  22.  
  23. #define ForCmd1 "PRACTICE"            ; GO command for Forum
  24. #define ForCmd2 "DSTORM"
  25. #define ForCmd3 "PPIFORUM"
  26. #define ForCmd4 "CPQFORUM"
  27. #define ForCmd5 "MECA"
  28. #define ForCmd6 "NORUTL"
  29. #define ForCmd7 "IBMCOM"
  30.  
  31. ;                    LOCAL STRING VARIABLES used = 3
  32. ;                    GLOBAL STRING VARIABLES - 93 used
  33.  
  34. string Order, Order1, Order2, Order3, Order4, Order5
  35. string Cfg1,Cfg2,Cfg3,Cfg4,Cfg5,Cfg6,Cfg7,Cfg8,Cfg9,Cfg10,Cfg0="#############"
  36. string MailDir,FileDir,LogDir,LogName,LogLoc,TempS,WordS,Join,SaveS,Char,Begin
  37. string Dirname,UseFile,Name,ToDay,Month,Day,UserFor,DesFile,ETime
  38. string Mailin, MailOut, MesgIn, MesgOut, FileIn, FileOut, Title, CISTitle
  39. String Locn1,Locn2,Locn3,Locn4,Locn5
  40. String Area1,Area2,Area3,Area4,Area5
  41. String Sect1,Sect2,Sect3,Sect4,Sect5
  42. String Actn1,Actn2,Actn3,Actn4,Actn5
  43. String Extn1,Extn2,Extn3,Extn4,Extn5
  44. String ShoTask1,ShoTask2,ShoTask3,ShoTask4,ShoTask5
  45. String File1,File2,File3,File4,File5,File6,File7,File8,File9,File10,FileList
  46. String Var1,Var2,Var3,Var4,Var5,Var6        ; extra terms needed in listing
  47.  
  48. ;                   LOCAL NUMERICAL VARIABLES used = 7 (2 are Long)
  49. ;                   GLOBAL NUMERICAL VARIABLES - 39 used
  50. integer Pick, Choice, Done, GoAhead, Count, KeepOn, Flag, Item, BinCnt
  51. integer MailRecd, MailSent, MesgRecd, MesgSent, FileRecd, FileSent, MailWait
  52. integer Cfg11, Cfg12, Cfg13, Cfg14, Cfg15, Cfg16
  53. integer Tour, TourMax
  54. ;integer Var, Num, Len, Temp
  55. ;        ^I6  ^I7  ^I8  ^I9
  56. ;integer MultiTask,Task1,Task2,Task3,Task4,Task5
  57. ;          ^I0     ^I1   ^I2   ^I3   ^I4   ^I5
  58. ;Long STime ==> L1
  59. ;Long Speed ==> L2
  60.  
  61. ; =========================  Beginning of Script  ============================
  62.  
  63. PROC Main
  64. integer newmenu, menu1, menu2, menu3, menu5, menu6
  65.    isfile "AUTOCIS.CFG"
  66.    if success
  67.       Call ReadCfg
  68.       MailDir=Cfg8                     ; define directories
  69.       FileDir=Cfg9
  70.       LogDir=Cfg10
  71.    else
  72.       sdlgmsgbox "Initial Program Startup" "Personal User information needed" STOP OK choice BEEP
  73.       Cfg11=1,Cfg12=0,Cfg13=1,Cfg14=0,Cfg15=1,Cfg16=0 ; defaults for CfgOptions
  74.       Begin="00:00"
  75.       Call PerConfig
  76.       Call DirConfig
  77.       Call SaveCfg
  78.    endif
  79.    if $FROMDDIR
  80.       Call LogOn
  81.       Call ExitWait
  82.       goto MainEnd
  83.    endif
  84.    fetch baudrate L2                   ; store existing baudrate at entrance
  85.    if eq Cfg11 1
  86.       Call ProgInfo
  87.    endif
  88.    getwintext $ACTIVEWIN Title
  89.    CISTitle="Running AUTOCIS script within PROCOMM PLUS for Windows"
  90.    pwtitlebar CISTitle
  91.  
  92.    menubar newmenu
  93.    menupopup newmenu "&Mail" menu1
  94.       menuitem menu1 1 "Send &Composed Mail"
  95.       menuitem menu1 2 "Send Mail &File"
  96.       menuitem menu1 3 "&Receive Mail"
  97.       menuitem menu1 4 "&Write/Edit Letter"
  98.       menuitem menu1 5 "&View/Edit Capture"
  99.  
  100.    menupopup newmenu "&Forums" menu2
  101.       menuitem menu2 6 Forum1
  102.       menuitem menu2 7 Forum2
  103.       menuitem menu2 8 Forum3
  104.       menuitem menu2 9 Forum4
  105.       menuitem menu2 10 Forum5
  106.       menuitem menu2 11 Forum6
  107.       menuitem menu2 12 Forum7
  108.       menuitem menu2 13 "&User Specified"
  109.  
  110.    menupopup newmenu "&Ziff Net" menu3
  111.       menuitem menu3 14 "&After Hours"
  112.       menuitem menu3 15 "&Editorial"
  113.       menuitem menu3 16 "&Programming"
  114.       menuitem menu3 17 "&Utilities"
  115.       menuitem menu3 18 "Public &Brand"
  116.       menuitem menu3 19 "&SoftLib Files"
  117.  
  118.    menupopup newmenu "&Setup" menu5
  119.       menuitem menu5 25 "&User Info"
  120.       menuitem menu5 26 "&Directory Info"
  121.       menuitem menu5 27 "&Options"
  122.       menuitem menu5 28 "&Save Setup"
  123.       menuitem menu5 29 "&Program Data"
  124.  
  125.    menupopup newmenu "&Other" menu6
  126.       menuitem menu6 30 "&Multiple Tasks"
  127.       menuitem menu6 31 "&Restart dialing"
  128.       menuitem menu6 32 "E&xit program"
  129.  
  130.    showmenu newmenu
  131.    if eq Cfg11 1
  132.       UserMsg "> Select Topic from top menu bar`r\
  133.           (Mail   Forum   Ziff Net .....)`r`r\
  134. > Choose area from drop down menu`r`r\
  135. > Dialog box will be displayed if needed`r`r\
  136. > Choose Activity from dialog box`r`r\
  137. { Turn off Option 1 to remove this display }"
  138.    endif
  139.    when menu call Controller
  140.    while 1
  141.    endwhile
  142. MainEnd:
  143. ENDPROC ;Main
  144.  
  145. PROC Controller
  146. integer status=$MENU
  147.  
  148.    clearwhen menu
  149.    switch status
  150.       case 1
  151.          Order="Mail"
  152.          Order1="GO CIS:MAIL"
  153.          Order2=$NULLSTR
  154.          Order3="Send Text"
  155.          GoAhead=1
  156.          Call Initiate
  157.       endcase
  158.       case 2
  159.          Order="Mail"
  160.          Order1="GO CIS:MAIL"
  161.          Order2=$NULLSTR
  162.          Order3="UPL"
  163.          Call Filename
  164.          Order3="Send File"
  165.          if Done=1
  166.             Call Initiate
  167.          endif
  168.       endcase
  169.       case 3
  170.          Order="Mail"
  171.          Order1="GO CIS:MAIL"
  172.          Order2=$NULLSTR
  173.          Order3="Get Mail"
  174.          GoAhead=1
  175.          Call Initiate
  176.       endcase
  177.       case 4
  178.          DirName=MailDir
  179.          UseFile="LETTERS.OUT"
  180.          Call DoEdit
  181.       endcase
  182.       case 5
  183.          DirName=LogDir
  184.          Call DefineLog
  185.          UseFile=LogName
  186.          Call DoEdit
  187.       endcase
  188.       case 6
  189.          Order="Forum"
  190.          Order1="GO CIS:"
  191.          strcat Order1 ForCmd1
  192.          Call Forum
  193.          Call Initiate
  194.       endcase
  195.       case 7
  196.          Order="Forum"
  197.          Order1="GO CIS:"
  198.          strcat Order1 ForCmd2
  199.          Call Forum
  200.          Call Initiate
  201.       endcase
  202.       case 8
  203.          Order="Forum"
  204.          Order1="GO CIS:"
  205.          strcat Order1 ForCmd3
  206.          Call Forum
  207.          Call Initiate
  208.       endcase
  209.       case 9
  210.          Order="Forum"
  211.          Order1="GO CIS:"
  212.          strcat Order1 ForCmd4
  213.          Call Forum
  214.          Call Initiate
  215.       endcase
  216.       case 10
  217.          Order="Forum"
  218.          Order1="GO CIS:"
  219.          strcat Order1 ForCmd5
  220.          Call Forum
  221.          Call Initiate
  222.       endcase
  223.       case 11
  224.          Order="Forum"
  225.          Order1="GO CIS:"
  226.          strcat Order1 ForCmd6
  227.          Call Forum
  228.          Call Initiate
  229.       endcase
  230.       case 12
  231.          Order="Forum"
  232.          Order1="GO CIS:"
  233.          strcat Order1 ForCmd7
  234.          Call Forum
  235.          Call Initiate
  236.       endcase
  237.       case 13
  238.          sdlginput "USER SPECIFIED FORUM" "Enter name of desired Forum" UserFor
  239.          Order1="GO CIS:"
  240.          strcat Order1 UserFor
  241.          Order="Forum"
  242.          Call Forum
  243.          Call Initiate
  244.       endcase
  245.       case 14
  246.          Order="Forum"
  247.          Order1="GO ZNT:AFTERHOURS"
  248.          Call Forum
  249.          Call Initiate
  250.       endcase
  251.       case 15
  252.          Order="Forum"
  253.          Order1="GO ZNT:EDITORIAL"
  254.          Call Forum
  255.          Call Initiate
  256.       endcase
  257.       case 16
  258.          Order="Forum"
  259.          Order1="GO ZNT:PROGRAM"
  260.          Call Forum
  261.          Call Initiate
  262.       endcase
  263.       case 17
  264.          Order="Forum"
  265.          Order1="GO ZNT:UTILFORUM"
  266.          Call Forum
  267.          Call Initiate
  268.       endcase
  269.       case 18
  270.          Order="Forum"
  271.          Order1="GO ZNT:PBS"
  272.          Call Forum
  273.          Call Initiate
  274.       endcase
  275.       case 19
  276.          Order="SoftLib"
  277.          Order1="GO ZNT:SOFTLIB"
  278.          Call SoftDef
  279.          Call Initiate
  280.       endcase
  281.       case 25
  282.          Call PerConfig
  283.       endcase
  284.       case 26
  285.          Call DirConfig
  286.       endcase
  287.       case 27
  288.          Call OptConfig
  289.       endcase
  290.       case 28
  291.          Call SaveCfg
  292.       endcase
  293.       case 29
  294.          Call ProgInfo
  295.       endcase
  296.       case 30
  297.          Call ClearTask
  298.          I0=1
  299.          Call Initiate
  300.       endcase
  301.       case 31                          ; this is Redial
  302.          GoAhead=1
  303.          Call Initiate
  304.       endcase
  305.       case 32                          ; if EXIT was selected
  306.          sdlgmsgbox "AutoCIS Script Program" "Do you want to exit the AutoCIS Script?"\
  307.           QUESTION YESNO I7 BEEP
  308.          switch I7
  309.             case 6                     ; this is yes
  310.                set baudrate L2         ; reset original baud rate
  311.                Title="PROCOMM PLUS for Windows"
  312.                pwtitlebar Title
  313.                halt
  314.             endcase
  315.             case 7                     ; this is no
  316.                pwtitlebar CISTitle
  317.                exitswitch
  318.             endcase
  319.          endswitch
  320.       endcase
  321.    endswitch
  322.    when menu call Controller
  323.  
  324. ENDPROC ;Controller
  325.  
  326. PROC Initiate
  327.    if eq I0 1                   ; indicates to store in Multi Task
  328.       Call Multi
  329.    endif
  330.    if eq GoAhead 0
  331.       goto InitiateOut                 ; go back for next task if MultiTasking
  332.    endif
  333.    if eq Tour 0
  334.       Call LogOn
  335.       if eq KeepOn 1                     ; if still connected
  336.          transmit Order1                 ; transmit specified destination
  337.          transmit "^M"
  338.       else
  339.          pwtitlebar CISTitle
  340.          goto InitiateOut                ; in case connection was lost
  341.       endif
  342.       Call PickArea
  343.       strcmp Order3 "Manual mode"        ; if this is Manual mode
  344.       if not success                     ;   logging off has been performed
  345.          Call LogOff
  346.       endif
  347.    else
  348.       Call OnTour
  349.    endif
  350.    pwtitlebar CISTitle
  351.    Call Summary
  352. InitiateOut:
  353.    GoAhead=0
  354. ENDPROC ;Initiate
  355.  
  356. PROC PickArea
  357.    switch Order
  358.       case "Mail"
  359.          Call MailRun                  ; on line Mail procedures
  360.       endcase
  361.       case "Forum"
  362.          Call ForumRun                 ; on line Forum procedures
  363.       endcase
  364.       case "SoftLib"
  365.          Call SoftRun                  ; on line Ziff Net SoftLib procedures
  366.       endcase
  367.    endswitch
  368. ENDPROC ;PickArea
  369.  
  370. PROC OnTour
  371.    Tour = 0
  372.    Order1=$NULLSTR
  373. StartTask:
  374.    inc Tour
  375.    TempS=Order1                        ; save previous Order1
  376.    switch Tour
  377.       case 1
  378.          Order=Locn1
  379.          Order1="GO "
  380.          strcat Order1 Area1
  381.          strupr Order1
  382.          Order2=Sect1
  383.          strupr Order2
  384.          Order3=Actn1
  385.          strupr Order3
  386.          Order4=Extn1
  387.       endcase
  388.       case 2
  389.          Order=Locn2
  390.          Order1="GO "
  391.          strcat Order1 Area2
  392.          strupr Order1
  393.          Order2=Sect2
  394.          strupr Order2
  395.          Order3=Actn2
  396.          strupr Order3
  397.          Order4=Extn2
  398.       endcase
  399.       case 3
  400.          Order=Locn3
  401.          Order1="GO "
  402.          strcat Order1 Area3
  403.          strupr Order1
  404.          Order2=Sect3
  405.          strupr Order2
  406.          Order3=Actn3
  407.          strupr Order3
  408.          Order4=Extn3
  409.       endcase
  410.       case 4
  411.          Order=Locn4
  412.          Order1="GO "
  413.          strcat Order1 Area4
  414.          strupr Order1
  415.          Order2=Sect4
  416.          strupr Order2
  417.          Order3=Actn4
  418.          strupr Order3
  419.          Order4=Extn4
  420.       endcase
  421.       case 5
  422.          Order=Locn5
  423.          Order1="GO "
  424.          strcat Order1 Area5
  425.          strupr Order1
  426.          Order2=Sect5
  427.          strupr Order2
  428.          Order3=Actn5
  429.          strupr Order3
  430.          Order4=Extn5
  431.       endcase
  432.    endswitch
  433.    if eq Tour 1                        ; if first multi task
  434.       Call LogOn
  435.       if eq KeepOn 1                   ; if not connected
  436.          transmit Order1               ; transmit specified destination
  437.          transmit "^M"
  438.       else
  439.          pwtitlebar CISTitle
  440.          goto TourOut                  ; in case connection was lost
  441.       endif
  442.    else                                ; if second or later multi task
  443.       strcmp TempS Order1              ; is this Order1 the same as the last ?
  444.       if success                       ; if staying in Forum
  445.          transmit "B^M"                ;     back up to top menu
  446.          waitfor "!" 3
  447.       else                             ; if new area is specified
  448.          transmit "EXIT^M"             ; exit forum - this stops command mode
  449.          waitfor "Enter choice" 10
  450.          transmit "T^M"                ; request CIS top menu
  451.          waitfor "Enter choice" 10
  452.          transmit Order1               ; send GO command for new area
  453.          transmit "^M"
  454.       endif
  455.    endif
  456. ; continue as if this is a single activity session
  457.    Call PickArea                       ; select where to go (Mail,Forum,Other)
  458. ; return here from Forum, Mail or Assist
  459.    if eq Tour TourMax
  460.       strcmp Order3 "Manual mode"      ; if this is Manual mode
  461.       if not success                   ;        logging off has been performed
  462.          Call LogOff
  463.       endif
  464.    else
  465.       if KeepOn
  466.          goto StartTask                ; go to perform next Task
  467.       endif
  468.    endif
  469.    Tour=0
  470.    TourMax=0
  471. TourOut:
  472. ENDPROC ;OnTour
  473.  
  474. PROC Summary
  475.    ITOA MailRecd MailIn
  476.    ITOA MailSent MailOut
  477.    ITOA MesgRecd MesgIn
  478.    ITOA MesgSent MesgOut
  479.    ITOA FileRecd FileIn
  480.    ITOA FileSent FileOut
  481.    dialogbox 120 90 125 115 2 "CIS ACTIVITY SUMMARY"
  482.       pushbutton 44 90 40 14 "&Proceed" normal
  483.       text  25 10 62 9 left "Letters Received :"
  484.       text  25 20 62 9 left "Letters  Sent       :"
  485.       text  25 35 62 9 left "Messages Rec'd  :"
  486.       text  25 45 62 9 left "Messages Sent    :"
  487.       text  25 60 62 9 left "Files DnLoaded   :"
  488.       text  25 70 62 9 left "Files UpLoaded   :"
  489.       vtext 90 10 20 9 left Mailin
  490.       vtext 90 20 20 9 left Mailout
  491.       vtext 90 35 20 9 left MesgIn
  492.       vtext 90 45 20 9 left MesgOut
  493.       vtext 90 60 20 9 left FileIn
  494.       vtext 90 70 20 9 left FileOut
  495.    enddialog
  496.    while not $DIALOG
  497.    endwhile
  498.    MailIn=$NULLSTR
  499.    MailOut=$NULLSTR
  500.    MesgIn=$NULLSTR
  501.    MesgOut=$NULLSTR
  502.    FileIn=$NULLSTR
  503.    FileOut=$NULLSTR
  504.    MailRecd=0
  505.    MailSent=0
  506.    MesgRecd=0
  507.    MesgSent=0
  508.    FileRecd=0
  509.    FileSent=0
  510. ENDPROC ;Summary
  511.  
  512. PROC ShoBox
  513.    dialogbox 120 50 120 150 2 "SELECTIONS"
  514.       groupbox 10 15 100 105 shadow
  515.       radiobutton 15 160 8 8 "" Pick
  516.       radiobutton 15 25 8 8 ""
  517.       radiobutton 15 35 8 8 ""
  518.       radiobutton 15 45 8 8 ""
  519.       radiobutton 15 55 8 8 ""
  520.       radiobutton 15 65 8 8 ""
  521.       radiobutton 15 75 8 8 ""
  522.       radiobutton 15 85 8 8 ""
  523.       radiobutton 15 95 8 8 ""
  524.       radiobutton 15 105 8 8 "" endgroup
  525.       pushbutton 10 130 45 15 "&Proceed" normal default
  526.       pushbutton 65 130 45 15 "&Cancel" normal
  527.       vtext 5 5 78 10 left S1
  528.       vtext 25 25 80 8 left S2
  529.       vtext 25 35 80 8 left S3
  530.       vtext 25 45 80 8 left S4
  531.       vtext 25 55 80 8 left S5
  532.       vtext 25 65 80 8 left S6
  533.       vtext 25 75 80 8 left S7
  534.       vtext 25 85 80 8 left S8
  535.       vtext 25 95 80 8 left S9
  536.       vtext 25 105 80 8 left S0
  537.    enddialog
  538. ENDPROC ;ShoBox
  539.  
  540. ;  -------------------------------------------
  541. ; |     DEFINITION  OF  FORUM  ACTIVITIES     |
  542. ;  -------------------------------------------
  543.  
  544. PROC Forum
  545.    Call JoinForum
  546.    Call SectionBox
  547.    choice=$DIALOG
  548.    while choice != 1
  549.       choice=$DIALOG
  550.       switch choice
  551.          case 10                       ; accept inputs & exit
  552.             Done=1
  553.             GoAhead=1
  554.             exitwhile
  555.          endcase
  556.          case 11                       ; cancel & exit
  557.             Done=0
  558.             GoAhead=0
  559.             Order1=$NULLSTR
  560.             Order2=$NULLSTR
  561.             Order3=$NULLSTR
  562.             Order4=$NULLSTR
  563.             exitwhile
  564.          endcase
  565.          case 50
  566.             switch Pick
  567.                case 1
  568.                endcase
  569.                case 2
  570.                   Order2="INSTRUCTIONS"
  571.                   Order3="Manual mode"
  572.                   usermsg "Requires User supplied commands"
  573.                endcase
  574.                case 3
  575.                   Order2="MESSAGES"
  576.                   Call ShoMes
  577.                   if eq Done 1
  578.                      exitwhile
  579.                   endif
  580.                   Pick=3
  581.                   Call SectionBox
  582.                endcase
  583.                case 4
  584.                   Order2="LIBRARIES"
  585.                   Call ShoLib
  586.                   if eq Done 1
  587.                      exitwhile
  588.                   endif
  589.                   Pick=3
  590.                   Call SectionBox
  591.                endcase
  592.                case 5
  593.                   Order2="CONFERENCE"
  594.                   Order3="Manual mode"
  595.                   usermsg "Requires User supplied commands"
  596.                endcase
  597.                case 6
  598.                   Order2="ANNOUNCE"
  599.                   Order3="Manual mode"
  600.                   usermsg "Requires User supplied commands"
  601.                endcase
  602.                case 7
  603.                   Order2="DIRECTORY"
  604.                   Order3="Manual mode"
  605.                   usermsg "Requires User supplied commands"
  606.                endcase
  607.                case 8
  608.                   Order2="OPTIONS"
  609.                   Order3="Manual mode"
  610.                   usermsg "Requires User supplied commands"
  611.                endcase
  612.                case 9
  613.                   Call ShoList
  614.                   Call SectionBox
  615.                endcase
  616.                case 10
  617.                   DirName=LogDir
  618.                   UseFile="MESSAGES."
  619.                   substr TempS Order1 7 3
  620.                   strcat UseFile TempS
  621.                   Call DoEdit
  622.                   Call SectionBox
  623.                endcase
  624.             endswitch
  625.          endcase
  626.       endswitch
  627.    endwhile
  628. ENDPROC ;Forum
  629.  
  630. PROC SectionBox
  631.    Pick=1
  632.    S1="FORUM SECTIONS"
  633.    S2="Instructions"
  634.    S3="Messages"
  635.    S4="Libraries"
  636.    S5="Conference"
  637.    S6="Announcements"
  638.    S7="Member Directory"
  639.    S8="Options of Forum"
  640.    S9="Section/Library List"
  641.    S0="Write/Edit message(s)"
  642.    Call ShoBox
  643. ENDPROC ;SectionBox
  644.  
  645. PROC ShoMes
  646.    Pick=1
  647.    S1="MESSAGE ACTIVITIES"
  648.    S2="Send message(s)"
  649.    S3="Read New"
  650.    S4="Read To"
  651.    S5="Read From"
  652.    S6="Read Thread"
  653.    S7="Find Root"
  654.    S8="Read Starting"
  655.    S9="Read Days"
  656.    S0="Delete message"
  657.    Call ShoBox
  658.    choice=$DIALOG
  659.    while choice != 1
  660.       choice=$DIALOG
  661.       switch choice
  662.          case 10                       ; accept inputs & exit
  663.             Done=1
  664.             GoAhead=1
  665.             exitwhile
  666.          endcase
  667.          case 11                       ; cancel & exit
  668.             Done=0
  669.             GoAhead=0
  670.             Order1=$NULLSTR
  671.             Order2=$NULLSTR
  672.             Order3=$NULLSTR
  673.             Order4=$NULLSTR
  674.             exitwhile
  675.          endcase
  676.          case 50
  677.             switch Pick
  678.                case 1
  679.                endcase
  680.                case 2
  681.                   Order3="Send Mesg"
  682.                   Order4=$NULLSTR
  683.                endcase
  684.                case 3
  685.                   Order3="REA NEW"
  686.                   Order4=$NULLSTR
  687.                endcase
  688.                case 4
  689.                   Order3="REA ALL TO:"
  690.                   sdlginput "INPUT REQUEST" "Enter User ID number" Order4
  691.                endcase
  692.                case 5
  693.                   Order3="REA ALL FRO "
  694.                   sdlginput "INPUT REQUEST" "Enter User ID number" Order4
  695.                endcase
  696.                case 6
  697.                   Order3="REA THR NUM:"
  698.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  699.                endcase
  700.                case 7
  701.                   Order3="ROO:"
  702.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  703.                endcase
  704.                case 8
  705.                   Order3="REA STA:"
  706.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  707.                endcase
  708.                case 9
  709.                   Order3="REA DAY:"
  710.                   sdlginput "INPUT REQUEST" "Enter number of days" Order4
  711.                endcase
  712.                case 10
  713.                   Order3="DEL:"
  714.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  715.                endcase
  716.             endswitch
  717.          endcase
  718.       endswitch
  719.    endwhile
  720. ENDPROC ;ShoMes
  721.  
  722. PROC ShoLib
  723.    Pick=1
  724.    Call LibBox
  725.    choice=$DIALOG
  726.    while choice != 1
  727.       choice=$DIALOG
  728.       switch choice
  729.          case 10                       ; accept inputs & exit
  730.             Done=1
  731.             GoAhead=1
  732.             exitwhile
  733.          endcase
  734.          case 11                       ; cancel & exit
  735.             Done=0
  736.             GoAhead=0
  737.             Order1=$NULLSTR
  738.             Order2=$NULLSTR
  739.             Order3=$NULLSTR
  740.             Order4=$NULLSTR
  741.             exitwhile
  742.          endcase
  743.          case 50
  744.             switch Pick
  745.                case 1
  746.                endcase
  747.                case 2
  748.                   Order3="Manual mode"
  749.                   Order4=$NULLSTR
  750.                   usermsg "Requires User supplied commands"
  751.                endcase
  752.                case 3                            ; this is browse of library
  753.                   Order3="BRO LIB:"
  754.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  755.                   strcat Order3 TempS
  756.                   Order4=$NULLSTR
  757.                   usermsg "Requires User supplied commands"
  758.                endcase
  759.                case 4                            ; this is count of files
  760.                   Order3="COU LIB:"
  761.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  762.                   strcat Order3 TempS
  763.                   Order4=$NULLSTR
  764.                endcase
  765.                case 5                            ; this is short directory
  766.                   Order3="LIST COU"
  767.                   sdlginput "INPUT REQUEST" "Enter Number of day(s), press \
  768. <CR> for all" TempS
  769.                   strcmp TempS $NULLSTR
  770.                   if failure
  771.                      strcat Order3 " AGE:"
  772.                      strcat Order3 TempS
  773.                   endif
  774.                   Order4=" LIB:"
  775.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  776.                   strcat Order4 TempS
  777.                endcase
  778.                case 6                            ; this is descriptive directory
  779.                   Order3="SCA DES"
  780.                   sdlginput "INPUT REQUEST" "Enter Number of day(s), press \
  781. <CR> for all" TempS
  782.                   strcmp TempS $NULLSTR
  783.                   if failure
  784.                      strcat Order3 " AGE:"
  785.                      strcat Order3 TempS
  786.                   endif
  787.                   Order4=" LIB:"
  788.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  789.                   strcat Order4 TempS
  790.                   sdlginput "INPUT REQUEST" "Enter Keywords for listing, \
  791. press <CR> to list all" TempS
  792.                   strcmp TempS $NULLSTR
  793.                   if failure
  794.                      strcat Order4 " KEY:"
  795.                      strcat Order4 TempS
  796.                   endif
  797.                endcase
  798.                case 7
  799.                   Order3="UPL"
  800.                   Call Filename
  801.                   Call LibBox
  802.                endcase
  803.                case 8
  804.                   Order3="DOW"
  805.                   Call Filename
  806.                   Call LibBox
  807.                endcase
  808.                case 9
  809.                   Order3="ERA"
  810.                   Call Filename
  811.                   Call LibBox
  812.                endcase
  813.                case 10
  814.                endcase
  815.             endswitch
  816.          endcase
  817.       endswitch
  818.    endwhile
  819. ENDPROC ;ShoLib
  820.  
  821. PROC ShoList
  822.    Call GetList
  823.    dialogbox 80 20 200 200 2 "SECTION DESCRIPTIONS"
  824.       text  15 4 116 8 left "Message Section List"
  825.       text  15 14 116 4 left "~~~~~~~~~~~~~~~"
  826.       text  115 4 116 8 left "Library Section List"
  827.       text  115 14 116 4 left "~~~~~~~~~~~~~~"
  828.       vtext 12 20 185 8 left S1
  829.       vtext 12 30 185 8 left S2
  830.       vtext 12 40 185 8 left S3
  831.       vtext 12 50 185 8 left S4
  832.       vtext 12 60 185 8 left S5
  833.       vtext 12 70 185 8 left S6
  834.       vtext 12 80 185 8 left S7
  835.       vtext 12 90 185 8 left S8
  836.       vtext 12 100 185 8 left S9
  837.       vtext 12 110 185 8 left S0
  838.       vtext 12 120 185 8 left var1
  839.       vtext 12 130 185 8 left var2
  840.       vtext 12 140 185 8 left var3
  841.       vtext 12 150 185 8 left var4
  842.       vtext 12 160 185 8 left var5
  843.       vtext 12 170 185 8 left var6
  844.       pushbutton 75 180 50 15 "Finished" normal default
  845.    enddialog
  846.    choice=$DIALOG
  847.    while choice != 1
  848.       choice=$DIALOG
  849.       if eq choice 10
  850.          exitwhile
  851.       endif
  852.    endwhile
  853. ENDPROC  ;ShoList
  854.  
  855. #INCLUDE "AUTOCIS.INC"
  856.  
  857. PROC LibBox
  858.    S1="LIBRARY ACTIVITIES"
  859.    S2="Manual mode"
  860.    S3="Browse"
  861.    S4="File Count"
  862.    S5="Short Directory"
  863.    S6="Descriptive Directory"
  864.    S7="Upload File(s)"
  865.    S8="Download File(s)"
  866.    S9="Remove File"
  867.    S0=""
  868.    Call ShoBox
  869. ENDPROC ;LibBox
  870.  
  871. PROC JoinForum
  872.     strlen Order1 I8
  873.     sub I8 7 I6
  874.     substr WordS Order1 7 I6          ; WordS is Area name (i.e. DSTORM)
  875.     isfile "AUTOCIS.LST"
  876.     if success
  877.        fopen 0 "AUTOCIS.LST" READ TEXT
  878.        while not FEOF 0
  879.           Fgets 0 TempS
  880.           strfind TempS WordS
  881.           if found
  882.              fclose 0
  883.              goto JoinOut
  884.           endif
  885.        endwhile
  886.        fclose 0
  887.     else
  888.        fopen 0 "AUTOCIS.LST" CREATE TEXT
  889.        fclose 0
  890.     endif
  891.     sdlgmsgbox "FORUM MEMBERSHIP STATUS" "You are presently not a member of this Forum !\
  892.             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \
  893.             Do you wish to JOIN the Forum at this time ?" STOP YESNO I7 BEEP
  894.     switch I7
  895.        case 6                          ; this is yes
  896.           Join=WordS                   ; Join is Area name
  897.           fopen 0 "AUTOCIS.LST" WRITE TEXT
  898.           fseek 0 0 2                  ; move pointer to just before EOF marker
  899.           strlen WordS I8
  900.           fwrite 0 WordS I8
  901.           fputc 0 10
  902.           fclose 0
  903.        endcase
  904.        case 7                          ; this is no
  905.           goto JoinOut
  906.        endcase
  907.     endswitch
  908. JoinOut:
  909. ENDPROC ;JoinForum
  910.  
  911. ;  --------------------------------------------------
  912. ; |     DEFINITION  OF  ZIFF SOFTLIB  ACTIVITIES     |
  913. ;  --------------------------------------------------
  914.  
  915. PROC SoftDef
  916.    Pick=1
  917.    Call SoftBox
  918.    choice=$DIALOG
  919.    while choice != 1
  920.       choice=$DIALOG
  921.       switch choice
  922.          case 10                       ; accept inputs & exit
  923.             Done=1
  924.             GoAhead=1
  925.             exitwhile
  926.          endcase
  927.          case 11                       ; cancel & exit
  928.             Done=0
  929.             GoAhead=0
  930.             Order1=$NULLSTR
  931.             Order2=$NULLSTR
  932.             Order3=$NULLSTR
  933.             Order4=$NULLSTR
  934.             exitwhile
  935.          endcase
  936.          case 50
  937.             switch Pick
  938.                case 1
  939.                endcase
  940.                case 2                            ; download latest files
  941.                   Order2="1"
  942.                   Order3="Manual mode"
  943.                   Order4=$NULLSTR
  944.                   usermsg "Requires User supplied commands"
  945.                endcase
  946.                case 3                            ; Essential software kits
  947.                   Order2="2"
  948.                   Order3="Manual mode"
  949.                   Order4=$NULLSTR
  950.                   usermsg "Requires User supplied commands"
  951.                endcase
  952.                case 4                            ; search for a utility
  953.                   Order2="3"
  954.                   Call SoftSearch
  955.                   if eq Done 1
  956.                      exitwhile
  957.                   endif
  958.                   Pick=4
  959.                   Call SoftBox
  960.                endcase
  961.                case 5                            ; download a utility
  962.                   Order2="4"
  963.                   Order3="DOW"
  964.                   Call FileName
  965.                   if eq Done 1
  966.                      exitwhile
  967.                   endif
  968.                   Pick=5
  969.                   Call SoftBox
  970.                endcase
  971.                case 6                            ; download a PCM utility
  972.                   Order2="7"
  973.                   Order3="Manual mode"
  974.                endcase
  975.                case 7                            ; about the Library
  976.                   Order2="10"
  977.                endcase
  978.                case 8                            ; search instructions
  979.                   Order2="11"
  980.                endcase
  981.                case 9                            ; uploading submissions
  982.                   Order2="12"
  983.                   Order3="Manual mode"
  984.                endcase
  985.                case 10
  986.                endcase
  987.             endswitch
  988.          endcase
  989.       endswitch
  990.    endwhile
  991. ENDPROC  ;SoftDef
  992.  
  993. PROC SoftBox
  994.    S1="SOFTLIB ACTIVITIES"
  995.    S2="Download Latest Files"
  996.    S3="Essential Software Kits"
  997.    S4="Search for a Utility"
  998.    S5="Download a Utility"
  999.    S6="About the Library"
  1000.    S7="Search Instructions"
  1001.    S8="Uploading Submissions"
  1002.    S9=""
  1003.    S0=""
  1004.    Call ShoBox
  1005. ENDPROC ;SoftBox
  1006.  
  1007. PROC SoftSearch
  1008.    Pick=1
  1009.    Call SearchBox
  1010.    choice=$DIALOG
  1011.    while choice != 1
  1012.       choice=$DIALOG
  1013.       switch choice
  1014.          case 10                       ; accept inputs & exit
  1015.             Done=1
  1016.             GoAhead=1
  1017.             exitwhile
  1018.          endcase
  1019.          case 11                       ; cancel & exit
  1020.             Done=0
  1021.             GoAhead=0
  1022.             Order1=$NULLSTR
  1023.             Order2=$NULLSTR
  1024.             Order3=$NULLSTR
  1025.             Order4=$NULLSTR
  1026.             exitwhile
  1027.          endcase
  1028.          case 50
  1029.             switch Pick
  1030.                case 1
  1031.                endcase
  1032.                case 2                            ; number 1 type utility
  1033.                   Order3="1"
  1034.                   Order4="Manual mode"
  1035.                   Order5=$NULLSTR
  1036.                   usermsg "Requires User supplied commands"
  1037.                endcase
  1038.                case 3                            ; number 2 keyword
  1039.                   Order3="2"
  1040.                   sdlginput "INPUT REQUEST" "Enter Keyword:" Order4
  1041.                   Order5=$NULLSTR
  1042.                endcase
  1043.                case 4                            ; number 3 PC M files
  1044.                   Order3="3"
  1045.                   Order4="Manual mode"
  1046.                   Order5=$NULLSTR
  1047.                   usermsg "Requires User supplied commands"
  1048.                endcase
  1049.                case 5                            ; number 4 PC C files
  1050.                   Order3="4"
  1051.                   Order4="Manual mode"
  1052.                   Order5=$NULLSTR
  1053.                   usermsg "Requires User supplied commands"
  1054.                endcase
  1055.                case 6                            ; number 5 PC W files
  1056.                   Order3="5"
  1057.                   Order4="Manual mode"
  1058.                   Order5=$NULLSTR
  1059.                   usermsg "Requires User supplied commands"
  1060.                endcase
  1061.                case 7                            ; number 6 File name
  1062.                   Order3="6"
  1063.                   sdlginput "INPUT REQUEST" "Enter Filename:" Order4
  1064.                   Order5=$NULLSTR
  1065.                endcase
  1066.                case 8                            ; number 7 Date
  1067.                   Order3="7"
  1068.                   sdlginput "INPUT REQUEST" "Enter Release date:" Order4
  1069.                   Order5=$NULLSTR
  1070.                endcase
  1071.                case 9                            ; number 8 Author
  1072.                   Order3="8"
  1073.                   sdlginput "INPUT REQUEST" "Enter Author UID #:" Order4
  1074.                   Order5=$NULLSTR
  1075.                endcase
  1076.                case 10
  1077.                endcase
  1078.             endswitch
  1079.          endcase
  1080.       endswitch
  1081.    endwhile
  1082. ENDPROC  ;SoftSearch
  1083.  
  1084. PROC Searchbox
  1085.    S1="SEARCH TYPE"
  1086.    S2="Type of Utility"
  1087.    S3="Keyword"
  1088.    S4="PC Magazine Files"
  1089.    S5="PC Computing Files"
  1090.    S6="PC Week Files"
  1091.    S7="File Name"
  1092.    S8="Date"
  1093.    S9="Author"
  1094.    S0=""
  1095.    Call ShoBox
  1096. ENDPROC ;SoftBox
  1097.  
  1098. ;  --------------------------------------------------------------
  1099. ; |     DEFINITION  OF  FILENAMES  FOR  UPLOAD  OR  DOWNLOAD     |
  1100. ;  --------------------------------------------------------------
  1101.  
  1102. PROC Filename
  1103.    FileList=Cfg9                          ; this is file directory
  1104.    strcat FileList "\File"
  1105.    strcat FileList Order3
  1106.    strcat FileList "."
  1107.    substr Char Order1 7 3
  1108.    strcat FileList Char
  1109.    isfile FileList
  1110.    if success
  1111.       sdlgmsgbox "FILENAME LIST" "Over write existing list ?" QUESTION YESNO choice
  1112.       switch choice
  1113.          case 7                        ; this is no
  1114.             Done=1
  1115.             GoAhead=1
  1116.             goto FilenameOut
  1117.          endcase
  1118.       endswitch
  1119.    endif
  1120.    fopen 0 FileList CREATE TEXT
  1121.    Call ClrFilename
  1122.    Call FileBox
  1123.    choice=$DIALOG
  1124.    while choice != 1
  1125.       choice=$DIALOG
  1126.       switch choice
  1127.          case 10                          ; add a filename
  1128.             Call DefineFile
  1129.             Call FileBox
  1130.          endcase
  1131.          case 11                          ; clear data
  1132.             fclose 0
  1133.             fopen 0 FileList CREATE TEXT  ; this clears the file to no contents
  1134.             Call ClrFilename
  1135.             Call FileBox
  1136.          endcase
  1137.          case 12                          ; cancel
  1138.             fclose 0
  1139.             fopen 0 FileList CREATE TEXT  ; clear the file contents
  1140.             fclose 0
  1141.             Done=0
  1142.             GoAhead=0
  1143.             exitwhile
  1144.          endcase
  1145.          case 13                          ; finished
  1146.             fwrite 0 "END" 3
  1147.             fputc 0 10
  1148.             fputc 0 10
  1149.             fclose 0
  1150.             Done=1
  1151.             GoAhead=1
  1152.             exitwhile
  1153.          endcase
  1154.       endswitch
  1155.    endwhile
  1156. FilenameOut:
  1157. ENDPROC ;Filename
  1158.  
  1159. PROC FileBox
  1160.    dialogbox 90 70 195 145 2 "UPLOAD/DOWNLOAD FILENAME DEFINITION"
  1161.       text  25 5 20 8 left "Lib #"
  1162.       text  50 5 20 8 left "Type"
  1163.       text  90 5 30 8 left "Filename"
  1164.       text  140 5 50 8 left "Source User ID"
  1165.       text  5 20 8 8 right "1"
  1166.       text  5 30 8 8 right "2"
  1167.       text  5 40 8 8 right "3"
  1168.       text  5 50 8 8 right "4"
  1169.       text  5 60 8 8 right "5"
  1170.       text  5 70 8 8 right "6"
  1171.       text  5 80 8 8 right "7"
  1172.       text  5 90 8 8 right "8"
  1173.       text  5 100 8 8 right "9"
  1174.       text  5 110 8 8 right "10"
  1175.       vtext 28 20 165 8 left File1
  1176.       vtext 28 30 165 8 left File2
  1177.       vtext 28 40 165 8 left File3
  1178.       vtext 28 50 165 8 left File4
  1179.       vtext 28 60 165 8 left File5
  1180.       vtext 28 70 165 8 left File6
  1181.       vtext 28 80 165 8 left File7
  1182.       vtext 28 90 165 8 left File8
  1183.       vtext 28 100 165 8 left File9
  1184.       vtext 28 110 165 8 left File10
  1185.       pushbutton 6 125 40 15 "&Add File" normal
  1186.       pushbutton 54 125 40 15 "C&lear Data" normal
  1187.       pushbutton 102 125 40 15 "&Cancel" normal
  1188.       pushbutton 150 125 40 15 "&Proceed" normal
  1189.    enddialog
  1190. ENDPROC ;FileBox
  1191.  
  1192. PROC ClrFilename
  1193.    File1=$NULLSTR
  1194.    File2=$NULLSTR
  1195.    File3=$NULLSTR
  1196.    File4=$NULLSTR
  1197.    File5=$NULLSTR
  1198.    File6=$NULLSTR
  1199.    File7=$NULLSTR
  1200.    File8=$NULLSTR
  1201.    File9=$NULLSTR
  1202.    File10=$NULLSTR
  1203. ENDPROC ;ClrFilename
  1204.  
  1205. PROC DefineFile
  1206.    strcmp Order1 "GO CIS:MAIL"
  1207.    if success
  1208.       WordS="           "
  1209.       goto SkipLib
  1210.    endif
  1211.    strcmp Order1 "GO ZNT:SOFTLIB"
  1212.    if success
  1213.       WordS="           "
  1214.       goto SkipLib
  1215.    endif
  1216.    sdlginput "LIBRARY DEFINITION" "Enter Library:" TempS
  1217.    strlen TempS I8
  1218.    if I8 != 2
  1219.       WordS="  "
  1220.       strcat WordS TempS
  1221.    else
  1222.       WordS=TempS
  1223.    endif
  1224.    strcat WordS "       "
  1225.    fwrite 0 TempS I8
  1226.    fputc 0 10
  1227. SkipLib:
  1228.    strcmp Order3 "UPL"
  1229.    if success
  1230.       sdlginput "FILE TYPE DEFINITION" "Enter Type of file (ASC,BIN):" TempS
  1231.       strupr TempS
  1232.       strcat WordS TempS
  1233.       strcmp TempS "BIN"
  1234.       if success
  1235.          strcat WordS "        "
  1236.       else
  1237.          strcat WordS "      "
  1238.       endif
  1239.       strlen TempS I8
  1240.       fwrite 0 TempS I8
  1241.       fputc 0 10
  1242.    else
  1243.       strcat WordS "              "
  1244.    endif
  1245.    sdlginput "FILENAME DEFINITION" "Enter Filename including extension:" TempS
  1246.    strupr TempS
  1247.    strcat WordS TempS
  1248.    strcat WordS "      "
  1249.    strlen TempS I8
  1250.    fwrite 0 TempS I8
  1251.    fputc 0 10
  1252.    strcmp Order3 "UPL"
  1253.    if success
  1254.       strcmp Order1 "GO CIS:MAIL"
  1255.       if success
  1256.          goto DefineFin
  1257.       endif
  1258. ; provide for ASCII send of Description
  1259.       usermsg "Provide Description - not to exceed 6 2/3 lines"
  1260. DescAgain:
  1261.       strcmpi $WINMODE "STANDARD"      ; not needed in Enhanced mode
  1262.       if success
  1263.          I7=$CONNECTION
  1264.          inc I7
  1265.          set connection port none
  1266.       endif
  1267.       Name=Cfg7                        ; this is editor path\filename
  1268.       strcat Name " "
  1269.       Char=Cfg9                        ; this is files directory
  1270.       strcat Char "\"
  1271.       strcat Char "DESCRIPT.TMP"
  1272.       strcat Name Char
  1273.       run Name MAXIMIZED
  1274.       strcmpi $WINMODE "STANDARD"      ; reset for Standard mode
  1275.       if success
  1276.          set connection port I7
  1277.       endif
  1278.       fopen 1 Char READ TEXT
  1279.       I7=0
  1280.       for I6=1 upto 7
  1281.          TempS=$NULLSTR
  1282.          fgets 1 TempS
  1283.          strcmp TempS $NULLSTR
  1284.          if success
  1285.             exitfor
  1286.          endif
  1287.          strlen TempS I8
  1288.          fwrite 0 TempS I8
  1289.          add I7 I8 I7
  1290.          inc I7
  1291.          fputc 0 10
  1292.       endfor
  1293.       fwrite 0 "/EXIT" 5
  1294.       fputc 0 10
  1295.       fclose 1
  1296.       sub I7 538 I7
  1297.       if I7 > 0
  1298.          BEEP
  1299.          add I7 48 I7
  1300.          usermsg "Description is over length by %c characters." I7
  1301.          goto DescAgain
  1302.       endif
  1303.       delfile Char                     ; deletes temporary file
  1304. ; input and store Keywords
  1305. DefineFin:
  1306.       TempS=$NULLSTR
  1307. KeyAgain:
  1308.       strcmp Order1 "GO CIS:MAIL"
  1309.       if success
  1310.          sdlginput "ADDRESSEE OF FILE" "Enter Addressee and user ID :" TempS DEFAULT
  1311.       else
  1312.          sdlginput "KEYWORDS FOR UPLOAD" "Enter Keywords for Upload (80 character maximum) :" TempS DEFAULT
  1313.       endif
  1314.       strlen TempS I8
  1315.       sub I8 80 I7
  1316.       if I7 > 0
  1317.          BEEP
  1318.          add I7 48 I7
  1319.          usermsg "Keywords is over length by %c characters." I7
  1320.          goto KeyAgain
  1321.       endif
  1322.       fwrite 0 TempS I8
  1323.       fputc 0 10
  1324. ; input and store Title
  1325.       TempS=$NULLSTR
  1326. TitleAgain:
  1327.       strcmp Order1 "GO CIS:MAIL"
  1328.       if success
  1329.          sdlginput "SUBJECT OF FILE" "Enter Subject for CIS use :" TempS DEFAULT
  1330.       else
  1331.          sdlginput "TITLE FOR UPLOAD" "Enter Title of Upload (47 character maximum) :" TempS DEFAULT
  1332.       endif
  1333.       strlen TempS I8
  1334.       sub I8 47 I7
  1335.       if I7 > 0
  1336.          BEEP
  1337.          add I7 48 I7
  1338.          usermsg "Title is over length by %c characters." I7
  1339.          goto TitleAgain
  1340.       endif
  1341.       strlen TempS I8
  1342.       fwrite 0 TempS I8
  1343.       fputc 0 10
  1344.    endif
  1345.    strcmp File1 $NULLSTR
  1346.    if success
  1347.       File1=WordS
  1348.       goto DefineEnd
  1349.    endif
  1350.    strcmp File2 $NULLSTR
  1351.    if success
  1352.       File2=WordS
  1353.       goto DefineEnd
  1354.    endif
  1355.    strcmp File3 $NULLSTR
  1356.    if success
  1357.       File3=WordS
  1358.       goto DefineEnd
  1359.    endif
  1360.    strcmp File4 $NULLSTR
  1361.    if success
  1362.       File4=WordS
  1363.       goto DefineEnd
  1364.    endif
  1365.    strcmp File5 $NULLSTR
  1366.    if success
  1367.       File5=WordS
  1368.       goto DefineEnd
  1369.    endif
  1370.    strcmp File6 $NULLSTR
  1371.    if success
  1372.       File6=WordS
  1373.       goto DefineEnd
  1374.    endif
  1375.    strcmp File7 $NULLSTR
  1376.    if success
  1377.       File7=WordS
  1378.       goto DefineEnd
  1379.    endif
  1380.    strcmp File8 $NULLSTR
  1381.    if success
  1382.       File8=WordS
  1383.       goto DefineEnd
  1384.    endif
  1385.    strcmp File9 $NULLSTR
  1386.    if success
  1387.       File9=WordS
  1388.       goto DefineEnd
  1389.    endif
  1390.    strcmp File10 $NULLSTR
  1391.    if success
  1392.       File10=WordS
  1393.       goto DefineEnd
  1394.    endif
  1395. DefineEnd:
  1396. ENDPROC ;DefineFile
  1397.  
  1398. ;  ---------------------------------------------------
  1399. ; |    PROCEDURES  FOR  DEFINING  MULTIPLE  TASKS     |
  1400. ;  ---------------------------------------------------
  1401.  
  1402. PROC Multi
  1403.    if eq Tour 1
  1404.       Locn1=Order
  1405.       substr Area1 Order1 3 10
  1406.       strlwr Area1
  1407.       Sect1=Order2
  1408.       strlwr Sect1
  1409.       Actn1=Order3
  1410.       strlwr Actn1
  1411.       ShoTask1=Order3
  1412.       Extn1=Order4
  1413.       strcat ShoTask1 Order4
  1414.       strlwr ShoTask1
  1415.    endif
  1416.    if eq Tour 2
  1417.       I1=1
  1418.       Locn2=Order
  1419.       substr Area2 Order1 3 10
  1420.       strlwr Area2
  1421.       Sect2=Order2
  1422.       strlwr Sect2
  1423.       Actn2=Order3
  1424.       strlwr Actn2
  1425.       ShoTask2=Order3
  1426.       Extn2=Order4
  1427.       strcat ShoTask2 Order4
  1428.       strlwr ShoTask2
  1429.    endif
  1430.    if eq Tour 3
  1431.       I1=1
  1432.       I2=1
  1433.       Locn3=Order
  1434.       substr Area3 Order1 3 10
  1435.       strlwr Area3
  1436.       Sect3=Order2
  1437.       strlwr Sect3
  1438.       Actn3=Order3
  1439.       strlwr Actn3
  1440.       ShoTask3=Order3
  1441.       Extn3=Order4
  1442.       strcat ShoTask3 Order4
  1443.       strlwr ShoTask3
  1444.    endif
  1445.    if eq Tour 4
  1446.       I1=1
  1447.       I2=1
  1448.       I3=1
  1449.       Locn4=Order
  1450.       substr Area4 Order1 3 10
  1451.       strlwr Area4
  1452.       Sect4=Order2
  1453.       strlwr Sect4
  1454.       Actn4=Order3
  1455.       strlwr Actn4
  1456.       ShoTask4=Order3
  1457.       Extn4=Order4
  1458.       strcat ShoTask4 Order4
  1459.       strlwr ShoTask4
  1460.    endif
  1461.    if eq Tour 5
  1462.       I1=1
  1463.       I2=1
  1464.       I3=1
  1465.       I4=1
  1466.       Locn5=Order
  1467.       substr Area5 Order1 3 10
  1468.       strlwr Area5
  1469.       Sect5=Order2
  1470.       strlwr Sect5
  1471.       Actn5=Order3
  1472.       strlwr Actn5
  1473.       ShoTask5=Order3
  1474.       Extn5=Order4
  1475.       strcat ShoTask5 Order4
  1476.       strlwr ShoTask5
  1477.    endif
  1478.    Call MultiBox
  1479.    choice=$DIALOG
  1480.    while choice != 1
  1481.       choice=$DIALOG
  1482.       switch choice
  1483.          case 10
  1484.             Call ClearTask
  1485.             Call MultiBox
  1486.          endcase
  1487.          case 11
  1488.             GoAhead=1
  1489.             I0=0
  1490.             exitwhile
  1491.          endcase
  1492.          case 12
  1493.             Call ClearTask
  1494.             GoAhead=0
  1495.             I0=0
  1496.             exitwhile
  1497.          endcase
  1498.          case 70
  1499.             if eq I1 1
  1500.                if eq Tour 0
  1501.                   Tour=1
  1502.                   GoAhead=0
  1503.                   exitwhile
  1504.                endif
  1505.             endif
  1506.          endcase
  1507.          case 71
  1508.             if eq I2 1
  1509.                if eq Tour 1
  1510.                   Tour=2
  1511.                   GoAhead=0
  1512.                   exitwhile
  1513.                endif
  1514.             endif
  1515.          endcase
  1516.          case 72
  1517.             if eq I3 1
  1518.                if eq Tour 2
  1519.                   Tour=3
  1520.                   GoAhead=0
  1521.                   exitwhile
  1522.                endif
  1523.             endif
  1524.          endcase
  1525.          case 73
  1526.             if eq I4 1
  1527.                if eq Tour 3
  1528.                   Tour=4
  1529.                   GoAhead=0
  1530.                   exitwhile
  1531.                endif
  1532.             endif
  1533.          endcase
  1534.          case 74
  1535.             if eq I5 1
  1536.                if eq Tour 4
  1537.                   Tour=5
  1538.                   GoAhead=0
  1539.                   exitwhile
  1540.                endif
  1541.             endif
  1542.          endcase
  1543.       endswitch
  1544.    endwhile
  1545.    destroydlg
  1546.    TourMax = Tour                      ; TourMax is total number of Tasks
  1547. ENDPROC ;Multi
  1548.  
  1549. PROC MultiBox
  1550.    dialogbox 75 90 205 110 6 "MULTIPLE TASK DEFINITION"
  1551.       text 10 10 190 70 left "DEFINE TASKS:"
  1552.       checkbox 15 22 35 10 "Task &1" I1
  1553.       checkbox 15 34 35 10 "Task &2" I2
  1554.       checkbox 15 46 35 10 "Task &3" I3
  1555.       checkbox 15 58 35 10 "Task &4" I4
  1556.       checkbox 15 70 35 10 "Task &5" I5
  1557.       pushbutton 10 88 55 15 "C&lear Tasks" normal
  1558.       pushbutton 75 88 55 15 "&Proceed" normal
  1559.       pushbutton 140 88 55 15 "&Cancel" normal
  1560.       vtext 55 24 33 9 left Area1
  1561.       vtext 55 36 33 9 left Area2
  1562.       vtext 55 48 33 9 left Area3
  1563.       vtext 55 60 33 9 left Area4
  1564.       vtext 55 72 33 9 left Area5
  1565.       vtext 90 24 35 9 left Sect1
  1566.       vtext 90 36 35 9 left Sect2
  1567.       vtext 90 48 35 9 left Sect3
  1568.       vtext 90 60 35 9 left Sect4
  1569.       vtext 90 72 35 9 left Sect5
  1570.       vtext 130 24 70 9 left ShoTask1             ; Actn + Extn
  1571.       vtext 130 36 70 9 left ShoTask2
  1572.       vtext 130 48 70 9 left ShoTask3
  1573.       vtext 130 60 70 9 left ShoTask4
  1574.       vtext 130 72 70 9 left ShoTask5
  1575.    enddialog
  1576. ENDPROC ;MultiBox
  1577.  
  1578. PROC ClearTask
  1579.    Tour=0
  1580.    I1=0
  1581.    I2=0
  1582.    I3=0
  1583.    I4=0
  1584.    I5=0
  1585.    Area1=$NULLSTR
  1586.    Area2=$NULLSTR
  1587.    Area3=$NULLSTR
  1588.    Area4=$NULLSTR
  1589.    Area5=$NULLSTR
  1590.    Sect1=$NULLSTR
  1591.    Sect2=$NULLSTR
  1592.    Sect3=$NULLSTR
  1593.    Sect4=$NULLSTR
  1594.    Sect5=$NULLSTR
  1595.    Actn1=$NULLSTR
  1596.    Actn2=$NULLSTR
  1597.    Actn3=$NULLSTR
  1598.    Actn4=$NULLSTR
  1599.    Actn5=$NULLSTR
  1600.    Extn1=$NULLSTR
  1601.    Extn2=$NULLSTR
  1602.    Extn3=$NULLSTR
  1603.    Extn4=$NULLSTR
  1604.    Extn5=$NULLSTR
  1605.    ShoTask1=$NULLSTR
  1606.    ShoTask2=$NULLSTR
  1607.    ShoTask3=$NULLSTR
  1608.    ShoTask4=$NULLSTR
  1609.    ShoTask5=$NULLSTR
  1610. ENDPROC ;ClearTask
  1611.  
  1612. ;  -------------------------------------------------
  1613. ; |    PROCEDURES  FOR  DEFINING  CONFIGURATION     |
  1614. ;  -------------------------------------------------
  1615.  
  1616. PROC PerConfig
  1617.    dialogbox 115 70 130 155 2 "PERSONAL INFORMATION"
  1618.       pushbutton 6 5 57 15 "&Access phone" update
  1619.       pushbutton 6 25 57 15 "&User ID number" update
  1620.       pushbutton 6 45 57 15 "&CIS Password" update
  1621.       pushbutton 6 65 57 15 "&Baud rate" update
  1622.       pushbutton 6 85 57 15 "&MNP message" update
  1623.       pushbutton 6 105 57 15 "&Name for Forum" update
  1624.       pushbutton 35 130 60 15 "&Finished" normal default
  1625.       vtext 66 8 60 12 left Cfg1
  1626.       vtext 66 28 60 12 left Cfg2
  1627.       vtext 66 48 60 12 left Cfg0
  1628.       vtext 66 68 60 12 left Cfg4
  1629.       vtext 66 88 60 12 left Cfg5
  1630.       vtext 66 108 60 12 left Cfg6
  1631.    enddialog
  1632.    choice=$DIALOG
  1633.    while choice != 1
  1634.       choice=$DIALOG
  1635.       switch choice
  1636.          case 10
  1637.             exitwhile
  1638.          endcase
  1639.          case 30
  1640.             sdlginput "Phone Request" "Input CIS access number:" Cfg1 DEFAULT
  1641.             updatedlg 64
  1642.          endcase
  1643.          case 31
  1644.             sdlginput "User ID Request" "Input your User ID number:" Cfg2 DEFAULT
  1645.             updatedlg 64
  1646.          endcase
  1647.          case 32
  1648.             sdlginput "Password Request" "Input your password:" Cfg3 DEFAULT
  1649.             updatedlg 64
  1650.          endcase
  1651.          case 33
  1652.             sdlginput "Baud Rate Request" "Input Baud rate:" Cfg4 DEFAULT
  1653.             updatedlg 64
  1654.          endcase
  1655.          case 34
  1656.             sdlginput "MNP response Request" "Input MNP message:" Cfg5 DEFAULT
  1657.             updatedlg 64
  1658.          endcase
  1659.          case 35
  1660.             sdlginput "Name for Forum Request" "Input name to use in Forum:" Cfg6 DEFAULT
  1661.             updatedlg 64
  1662.          endcase
  1663.       endswitch
  1664.    endwhile
  1665. ENDPROC ;PerConfig
  1666.  
  1667. PROC DirConfig
  1668.    dialogbox 80 70 200 115 2 "DIRECTORY INFORMATION"
  1669.       pushbutton 6 5 57 15 "&Editor Filename" update
  1670.       pushbutton 6 25 57 15 "&Mail Directory" update
  1671.       pushbutton 6 45 57 15 "&File Directory" update
  1672.       pushbutton 6 65 57 15 "&Log Directory" update
  1673.       pushbutton 70 90 60 15 "&Finished" normal default
  1674.       vtext 66 8 130 12 left Cfg7
  1675.       vtext 66 28 130 12 left Cfg8
  1676.       vtext 66 48 130 12 left Cfg9
  1677.       vtext 66 68 130 12 left Cfg10
  1678.    enddialog
  1679.    choice=$DIALOG
  1680.    while choice != 1
  1681.       choice=$DIALOG
  1682.       switch choice
  1683.          case 10
  1684.             exitwhile
  1685.          endcase
  1686.          case 30
  1687.             sdlginput "Editor Filename Request" "Input complete Path:" Cfg7 DEFAULT
  1688.             updatedlg 64
  1689.          endcase
  1690.          case 31
  1691.             sdlginput "Mail Directory Request" "Input complete Path:" Cfg8 DEFAULT
  1692.             updatedlg 64
  1693.          endcase
  1694.          case 32
  1695.             sdlginput "File Directory Request" "Input complete Path:" Cfg9 DEFAULT
  1696.             updatedlg 64
  1697.          endcase
  1698.          case 33
  1699.             sdlginput "Capture log Directory Request" "Input complete Path:" Cfg10 DEFAULT
  1700.             updatedlg 64
  1701.          endcase
  1702.       endswitch
  1703.    endwhile
  1704. ENDPROC ;DirConfig
  1705.  
  1706. PROC OptConfig
  1707.    dialogbox 130 70 100 125 2 "OPTION INFORMATION"
  1708.       checkbox 15 5 80 12 "Show Program &Info" Cfg11
  1709.       checkbox 15 20 80 12 "&Delete Mail" Cfg12
  1710.       checkbox 15 35 80 12 "&Confirm Dialing" Cfg13
  1711.       checkbox 15 50 80 12 "Command &mode" Cfg14
  1712.       checkbox 15 65 80 12 "Confirm Mail &Pickup" Cfg15
  1713.       checkbox 15 80 80 12 "&Suspend Dialing" Cfg16
  1714.       pushbutton 20 100 60 15 "&Finished" normal default
  1715.    enddialog
  1716.    choice=$DIALOG
  1717.    while choice != 1
  1718.       choice=$DIALOG
  1719.       switch choice
  1720.          case 10
  1721.             exitwhile
  1722.          endcase
  1723.       endswitch
  1724.    endwhile
  1725.    if eq Cfg16 1
  1726.       sdlginput "SUSPEND TIME DEFINITION" "Enter military time in HH:MM format:" Begin
  1727.    else
  1728.       Begin="00:00"
  1729.    endif
  1730. ENDPROC ;OptConfig
  1731.  
  1732. PROC ReadCfg
  1733.     fopen 0 "AUTOCIS.CFG" READ         ; opens configuration file for read only
  1734.     for I7=1 UPTO 17
  1735.        fgets 0 Name
  1736.        strlen Name I6
  1737.        dec I6
  1738.        dec I6
  1739.        switch I7
  1740.           case 1
  1741.              SUBSTR Cfg1 Name 0 I6
  1742.           endcase
  1743.           case 2
  1744.              SUBSTR Cfg2 Name 0 I6
  1745.           endcase
  1746.           case 3
  1747.              SUBSTR Cfg3 Name 0 I6
  1748.           endcase
  1749.           case 4
  1750.              SUBSTR Cfg4 Name 0 I6
  1751.           endcase
  1752.           case 5
  1753.              SUBSTR Cfg5 Name 0 I6
  1754.           endcase
  1755.           case 6
  1756.              SUBSTR Cfg6 Name 0 I6
  1757.           endcase
  1758.           case 7
  1759.              SUBSTR Cfg7 Name 0 I6
  1760.           endcase
  1761.           case 8
  1762.              SUBSTR Cfg8 Name 0 I6
  1763.           endcase
  1764.           case 9
  1765.              SUBSTR Cfg9 Name 0 I6
  1766.           endcase
  1767.           case 10
  1768.              SUBSTR Cfg10 Name 0 I6
  1769.           endcase
  1770.           case 11
  1771.              SUBSTR TempS Name 0 I6
  1772.              ATOI TempS Cfg11
  1773.           endcase
  1774.           case 12
  1775.              SUBSTR TempS Name 0 I6
  1776.              ATOI TempS Cfg12
  1777.           endcase
  1778.           case 13
  1779.              SUBSTR TempS Name 0 I6
  1780.              ATOI TempS Cfg13
  1781.           endcase
  1782.           case 14
  1783.              SUBSTR TempS Name 0 I6
  1784.              ATOI TempS Cfg14
  1785.           endcase
  1786.           case 15
  1787.              SUBSTR TempS Name 0 I6
  1788.              ATOI TempS Cfg15
  1789.           endcase
  1790.           case 16
  1791.              SUBSTR TempS Name 0 I6
  1792.              ATOI TempS Cfg16
  1793.           endcase
  1794.           case 17
  1795.              SUBSTR Begin Name 0 I6
  1796.           endcase
  1797.        endswitch
  1798.     endfor
  1799.     fclose 0
  1800. ENDPROC ;ReadCfg
  1801.  
  1802. PROC SaveCfg
  1803.     isfile "AUTOCIS.CFG"
  1804.     if success
  1805.        fopen 0 "AUTOCIS.CFG" WRITE
  1806.     else
  1807.        fopen 0 "AUTOCIS.CFG" CREATE
  1808.     endif
  1809.     strlen Cfg1 I8
  1810.     fwrite 0 Cfg1 I8
  1811.     fputc 0 13
  1812.     fputc 0 10
  1813.     strlen Cfg2 I8
  1814.     fwrite 0 Cfg2 I8
  1815.     fputc 0 13
  1816.     fputc 0 10
  1817.     strlen Cfg3 I8
  1818.     fwrite 0 Cfg3 I8
  1819.     fputc 0 13
  1820.     fputc 0 10
  1821.     strlen Cfg4 I8
  1822.     fwrite 0 Cfg4 I8
  1823.     fputc 0 13
  1824.     fputc 0 10
  1825.     strlen Cfg5 I8
  1826.     fwrite 0 Cfg5 I8
  1827.     fputc 0 13
  1828.     fputc 0 10
  1829.     strlen Cfg6 I8
  1830.     fwrite 0 Cfg6 I8
  1831.     fputc 0 13
  1832.     fputc 0 10
  1833.     strlen Cfg7 I8
  1834.     fwrite 0 Cfg7 I8
  1835.     fputc 0 13
  1836.     fputc 0 10
  1837.     strlen Cfg8 I8
  1838.     fwrite 0 Cfg8 I8
  1839.     fputc 0 13
  1840.     fputc 0 10
  1841.     strlen Cfg9 I8
  1842.     fwrite 0 Cfg9 I8
  1843.     fputc 0 13
  1844.     fputc 0 10
  1845.     strlen Cfg10 I8
  1846.     fwrite 0 Cfg10 I8
  1847.     fputc 0 13
  1848.     fputc 0 10
  1849.     ITOA Cfg11 TempS
  1850.     fwrite 0 TempS 1
  1851.     fputc 0 13
  1852.     fputc 0 10
  1853.     ITOA Cfg12 TempS
  1854.     fwrite 0 TempS 1
  1855.     fputc 0 13
  1856.     fputc 0 10
  1857.     ITOA Cfg13 TempS
  1858.     fwrite 0 TempS 1
  1859.     fputc 0 13
  1860.     fputc 0 10
  1861.     ITOA Cfg14 TempS
  1862.     fwrite 0 TempS 1
  1863.     fputc 0 13
  1864.     fputc 0 10
  1865.     ITOA Cfg15 TempS
  1866.     fwrite 0 TempS 1
  1867.     fputc 0 13
  1868.     fputc 0 10
  1869.     ITOA Cfg16 TempS
  1870.     fwrite 0 TempS 1
  1871.     fputc 0 13
  1872.     fputc 0 10
  1873.     strlen Begin I8
  1874.     fwrite 0 Begin I8
  1875.     fputc 0 13
  1876.     fputc 0 10
  1877.     fclose 0
  1878. ENDPROC ;SaveCfg
  1879.  
  1880. PROC ProgInfo
  1881.    dialogbox 110 70 140 125 2 "PROGRAM INFORMATION"
  1882.       text  10 8 120 8 center "Procomm for Windows V1.xx script"
  1883.       text  15 25 110 8 center "A U T O C I S"
  1884.       text  15 32 110 4 center "~~~~~~~~~~"
  1885.       text  15 38 110 8 center "Version 1.01"
  1886.       text  15 54 110 8 center "Released 10 December 1992"
  1887.       text  15 64 110 8 center "Written by Ralph Deitrick"
  1888.       text  15 74 110 8 center "CompuServe UID 76547,3434"
  1889.       text  15 88 110 8 center "PLEASE read AUTOCIS.DOC"
  1890.       pushbutton 50 102 40 15 "OK" normal default
  1891.    enddialog
  1892.    choice=$DIALOG
  1893.    while choice != 1
  1894.       choice=$DIALOG
  1895.       if eq choice 10
  1896.          exitwhile
  1897.       endif
  1898.    endwhile
  1899. ENDPROC ;ProgInfo
  1900.  
  1901. ;  ------------------------------------------
  1902. ; |    PROCEDURES  FOR  INVOKING  EDITOR     |
  1903. ;  ------------------------------------------
  1904.  
  1905. PROC DoEdit
  1906.    Call ShoDirBox
  1907.    while choice != 1
  1908.       choice=$DIALOG
  1909.       switch choice
  1910.          case 10
  1911.             Name=Cfg7                  ; this is editor definition
  1912.             strcat Name " "
  1913.             strlen UseFile I8
  1914.             if LE I8 12                     ; if UseFile lacks Path
  1915.                strcat Name DirName          ; add the directory
  1916.                strcat Name "\"              ; add dir file separator
  1917.             endif
  1918.             strcat Name UseFile
  1919.             run Name MAXIMIZED
  1920.             Call ShoDirBox
  1921.          endcase
  1922.          case 11
  1923.             TempS=UseFile
  1924.             sdlginput "RENAME INPUT REQUEST" "Input new Path\filename:" TempS DEFAULT
  1925.             rename UseFile TempS
  1926.             Call ShoDirBox
  1927.          endcase
  1928.          case 12
  1929.             TempS="Are you sure you want to delete "
  1930.             strcat TempS UseFile
  1931.             strcat TempS " ?"
  1932.             sdlgmsgbox "DELETION CONFIRMATION" TempS STOP YESNO I7
  1933.             if eq I7 6
  1934.                delfile UseFile
  1935.                if not success
  1936.                   errormsg "Can't delete %s !" UseFile
  1937.                endif
  1938.             elseif eq I7 7
  1939.                usermsg "File deletion canceled !"
  1940.             endif
  1941.             Call ShoDirBox
  1942.          endcase
  1943.          case 13
  1944.             TempS=Usefile
  1945.             sdlginput "COPY FILE DESTINATION" "Input new Path\filename:" TempS DEFAULT
  1946.             strcmp TempS UseFile
  1947.             if success
  1948.                errormsg "File can not be copied unto itself !"
  1949.             else
  1950.                copyfile UseFile TempS
  1951.                if not success
  1952.                   errormsg "File copy not successful !"
  1953.                endif
  1954.             endif
  1955.             Call ShoDirBox
  1956.          endcase
  1957.          case 14
  1958.             sdlginput "DIRECTORY REQUEST" "Input COMPLETE Directory Path:" DirName DEFAULT
  1959.             Call ShoDirBox
  1960.          endcase
  1961.          case 15
  1962.             exitwhile
  1963.          endcase
  1964.       endswitch
  1965.    endwhile
  1966. ENDPROC ;DoEdit
  1967.  
  1968. PROC ShoDirBox
  1969.    dialogbox 115 50 130 130 2 "DOCUMENT REVIEWER"
  1970.       dirlistbox 68 16 56 110 DirName single UseFile
  1971.       vtext 5 4 123 9 left DirName
  1972.       pushbutton 7 16 50 14 "&Write/Edit" normal default
  1973.       pushbutton 7 34 50 14 "&Rename File" normal
  1974.       pushbutton 7 52 50 14 "D&elete File" normal
  1975.       pushbutton 7 70 50 14 "&Copy File" normal
  1976.       pushbutton 7 88 50 14 "Change &Dir" normal
  1977.       pushbutton 7 106 50 14 "&Finished" normal
  1978.    enddialog
  1979. ENDPROC ;ShoDirBox
  1980.  
  1981. ; ****************************************************************************
  1982. ; *                                                                          *
  1983. ; *                OPERATIONS  ON  LINE  WITH  COMPUSERVE                    *
  1984. ; *                                                                          *
  1985. ; ****************************************************************************
  1986.  
  1987. ;  ----------------------------------------------------------
  1988. ; |    PROCEDURES  FOR  MAIL  OPERATIONS  ON  COMPUSERVE     |
  1989. ;  ----------------------------------------------------------
  1990. PROC MailRun                           ; need to catch "no mail waiting"
  1991.     if Tour >= 2
  1992.        strcmp TempS Order1
  1993.        if success
  1994.           pause 1
  1995.           goto DoMail
  1996.        endif
  1997.     endif
  1998.     waitfor "Mail  Main" 20
  1999.     waitfor "no mail" 1                ; choice will occur during this waitfor
  2000.     if success
  2001.        MailWait=0                      ; indicates no mail waiting  (No)
  2002.     else
  2003.        MailWait=1                      ; indicates there is mail waiting (Yes)
  2004.    endif
  2005.    waitfor "choice !" 1                ; likely occurs while waitfor "no mail"
  2006.    count=0
  2007.    if eq Cfg14 1                       ; this indicates command mode
  2008.       S0="Mail!"                       ; top menu
  2009.       S2="Action!"                     ; action menu
  2010.       S3="Send!"                       ; Send menu
  2011.       transmit "SET MOD COM^M"
  2012.    else
  2013.       S0="Main Menu"
  2014.       S2="<CR>"
  2015.       S3="Send Menu"                   ; Send menu
  2016.       transmit "SET MOD MEN^M"
  2017.    endif
  2018.    waitfor "choice !" 3                ; wait for end of Menu
  2019. DoMail:
  2020.    substr TempS Order3 0 6
  2021.    switch TempS
  2022.       case "Send T"
  2023.          Call SendText
  2024.       endcase
  2025.       case "Send F"
  2026.          Call FileSend
  2027.       endcase
  2028.       case "Get Ma"
  2029.          if eq MailWait 1
  2030.             Call GetMail
  2031.          else
  2032.             MailRecd=0
  2033.          endif
  2034.       endcase
  2035.    endswitch
  2036. ENDPROC ;MailRun
  2037.  
  2038. PROC SendText                          ; sends ASCII Mail files
  2039.    transmit "SET EDI NOL^M"
  2040.    WAITFOR "choice !" 3
  2041.    when Target 1 S2 Call TransCR        ; this is press <CR>
  2042.    when Target 2 S0 Call ClrFlag        ; this is Mail! & sets Flag=0
  2043.    capture off
  2044.    set capture mode append visual
  2045.    capture on
  2046.    Flag=1
  2047.    Name =  MailDir
  2048.    strcat Name "\LETTERS.OUT"
  2049.    SendFile ASCII Name
  2050.    while flag                          ; waiting for Mail! prompt
  2051.    endwhile
  2052.    capture off
  2053.    set capture mode append filtered
  2054.    capture on
  2055.    fopen 0 Name READWRITE TEXT
  2056.    while not FEOF 0
  2057.       fgets 0 Char
  2058.       strcmp Char "/SEND" 5
  2059.       if success
  2060.          inc Count
  2061.       endif
  2062.    endwhile
  2063.    strfmt TempS "           *****  SENT @ %s on %s  *****" $time $date
  2064.    fwrite 0 TempS 54
  2065.    fclose 0
  2066.    clearwhen Target 1
  2067.    clearwhen Target 2
  2068.    add MailSent Count MailSent
  2069. ENDPROC ;SendText
  2070.  
  2071. PROC FileSend                          ; uploads Binary mail files
  2072.     DesFile=FileDir
  2073.     STRCAT DesFile "\FileUPL.MAI"
  2074.     FOPEN 0 DesFile READ TEXT
  2075. StartBin:
  2076.     Call GetParam
  2077.     strcmp TempS "END" 3
  2078.     if success
  2079.        fclose 0
  2080.        goto EndBinMail
  2081.     endif
  2082.     transmit "UPL/PRO:B/TYP:"
  2083.     transmit TempS                     ; this is ASC or BIN
  2084.     transmit "^M"
  2085.     waitfor "computer:" 5
  2086.      when target 1 "Press <CR>" call TransCR
  2087.      set autodnld ON
  2088.      set terminal enquiry CISB         ; set for automatic cisb download
  2089.     Name=MailDir
  2090.     strcat Name "\"
  2091.     Call GetParam
  2092.     strcat Name TempS
  2093.     transmit Name
  2094.     transmit "^M"
  2095.     waitfor "" 5                      ; wait for enquiry
  2096.     Call DoTransfer
  2097.     waitfor "User ID):" 15
  2098.     set autodnld OFF
  2099.     set terminal enquiry OFF
  2100.     if eq Item 3
  2101.        fclose 0
  2102.        goto EndBinMail
  2103.     endif
  2104.     Call GetParam                      ; responding to User ID prompt
  2105.     transmit TempS                     ; this is addressee
  2106.     transmit "^M"
  2107.     waitfor "Subject:" 5
  2108.     Call GetParam
  2109.     transmit TempS                     ; this is subject of BIN file
  2110.     transmit "^M"
  2111.     waitfor "(Y or N)" 3
  2112.     pause 1
  2113.     transmit "Y^M"                     ; confirms addressee and subject
  2114.     waitfor S0 2                       ; "Mail" prompt after "sent" conformation
  2115.     clearwhen target 1
  2116.     if eq KeepOn 1
  2117.        goto StartBin                   ; return to send next file
  2118.     endif
  2119. EndBinMail:
  2120.     ADD MailSent count MailSent        ; Count is limited to 9 maximum
  2121. ENDPROC ;FileSend
  2122.  
  2123. PROC GetMail
  2124.    transmit "SET PAG NO^M"             ; set paging off
  2125.    waitfor "choice !"                  ; wait for end of Menu
  2126.    Count=0
  2127.    BinCnt=0
  2128.    Item=0
  2129.    clearwhen Target 0
  2130.    when Target 0 "age is B" Call GetBin        ; this is "Message is Binary"
  2131.    when target 1 S0 Call ClrFlag               ; this is "Mail!"
  2132.    when Target 2 S2 Call MailDispose           ; this is Action! or press <CR>
  2133.    transmit "REA ALL"                          ; request read all mail
  2134.    Flag=1
  2135.    transmit "^M"
  2136.    while Flag
  2137.    endwhile
  2138.    clearwhen Target 0
  2139.    clearwhen Target 1
  2140.    clearwhen Target 2
  2141.    when Target 0 "% Invalid" CALL GoManual   ; protection against "bad" commands
  2142.    add MailRecd count MailRecd                 ; total of mail received
  2143. ENDPROC ;GetMail
  2144.  
  2145. PROC GetBin
  2146.    clearwhen Target 2
  2147.    Call MailDL
  2148.    Call MailDispose
  2149.    when Target 2 S2 Call MailDispose           ; this is Action! or press <CR>
  2150. ENDPROC ;GetBin
  2151.  
  2152. PROC MailDispose
  2153.    pause 1
  2154.    if eq Cfg14 0                       ; this indicates menu mode
  2155.       transmit "^M"                    ; answer to press <CR>
  2156.       mspause 500                      ; wait for action menu
  2157.    endif
  2158.    switch Cfg12
  2159.       case 0                           ; means don't delete mail
  2160.          transmit "SAV"
  2161.       endcase
  2162.       case 1                           ; means delete mail after retrieval
  2163.          if eq Item 3                  ; this is download failure
  2164.             Item=0
  2165.             transmit "SAV"
  2166.          else
  2167.             transmit "DEL"
  2168.          endif
  2169.       endcase
  2170.    endswitch
  2171.    inc Count                           ; account for another letter received
  2172.    transmit "^M"                       ; deletes or saves mail
  2173. ENDPROC ;MailDispose
  2174.  
  2175. PROC MailDL
  2176.    INC BinCnt
  2177.    Name="BINLTR"
  2178.    ITOA BinCnt Char
  2179.    strcat Name Char
  2180.    set autodnld ON
  2181.    set terminal enquiry CISB           ; set for automatic cisb download
  2182.    transmit "DOW/PRO:B^M"              ; download with CompuServe B Protocol
  2183. ; try to recover Binary filename
  2184.    while 1                             ; loop checking for filename
  2185.       waitfor "/" 5
  2186.       rget TempS 30 1                  ; get 30 characters of received data
  2187.       strfind TempS "." I7            ; period between filename & extension
  2188.       if found
  2189.          sub I7 8 I8                 ; allow for 8 character filename
  2190.          dec I7                       ; move to left of decimal
  2191.          for I6=I7 downto I8        ; check backward for 8 characters
  2192.             strpeek TempS I6 I9
  2193.             if ge I9 48              ; this is zero
  2194.                if le I9 57           ; this is 9
  2195.                   loopfor              ; continues if character is a number
  2196.                endif
  2197.             endif
  2198.             if le I9 64              ; stops for space, slash, colon, etc.
  2199.                sub I7 I6 I7          ; number of characters in filename
  2200.                add I7 4 I7           ; add for decimal and extension
  2201.                Inc I6                 ; move right to first letter
  2202.                substr Name TempS I6 I7      ; get filename plus extension
  2203.                exitwhile               ; go to download once filename is found
  2204.             endif
  2205.          endfor
  2206.       else                             ; in case "." not found, ie no filename
  2207.          exitwhile
  2208.       endif                            ;        is found
  2209.    endwhile
  2210.    waitfor "computer:" 5
  2211. ; perform the actual download
  2212.     transmit MailDir
  2213.     transmit "\"
  2214.     transmit Name
  2215.     transmit "^M"
  2216.    Call DoTransfer
  2217.    if eq Item 2
  2218.       dec Count
  2219.    endif
  2220.    set autodnld OFF
  2221.    set terminal enquiry OFF            ; turn off enquiry response
  2222. ENDPROC ;MailDL
  2223.  
  2224. ;  -----------------------------------------------------------
  2225. ; |    PROCEDURES  FOR  FORUM  OPERATIONS  ON  COMPUSERVE     |
  2226. ;  -----------------------------------------------------------
  2227.  
  2228. PROC ForumRun
  2229.     when target 1 "waiting" Call GetWaiting
  2230.     Count=0
  2231.     if Tour >= 2
  2232.        strcmp TempS Order1
  2233.        if success
  2234.           clearwhen Target 1          ; no need for "waiting" if still in Forum
  2235.           goto DoTask
  2236.        endif
  2237.     endif
  2238.     if eq Cfg13 1
  2239.        S1="Messages !"
  2240.        S2="Forum !"
  2241.        S3="ages !"
  2242.        S4=" !"
  2243.     else
  2244.        S1="choice !"
  2245.        S2="choice !"
  2246.        S3="choice !"
  2247.        S4=" !"
  2248.     endif
  2249. ; check for messages waiting upon entering Forum
  2250.     waitfor "Welcome" 60               ; entrance to Forum - may take a long
  2251.     waitfor "<CR> !" 15                ;           time if SysOp messages
  2252.                                        ; if waiting, read will occur here
  2253.     if eq Cfg13 1                      ; this means command mode
  2254.        transmit "OPT;MOD COM;PAU NEV;S^M"  ; sent to ans "Press <CR> !"
  2255.     else
  2256.        transmit "OPT;MOD MEN;PAU NEV;S^M"  ; sent to ans "Press <CR> !"
  2257.     endif
  2258.     waitfor S2 5                       ; signifies end of Forum Menu
  2259.     clearwhen Target 1                 ; no need for "waiting" prompt any more
  2260. ; now check to see if joining the Forum is desired
  2261.     strlen Order1 I8
  2262.     sub I8 7 I6
  2263.     substr WordS Order1 7 I6          ; WordS is Area name (i.e. DSTORM)
  2264.     strcmp Join WordS                  ; is joining necessary ?
  2265.     if success                         ; yes, joining is desired
  2266.        transmit "Join"                 ; indicate selection is JOIN
  2267.        waitfor "Name:" 5
  2268.         transmit Cfg9                  ; send your name
  2269.         transmit "^M"
  2270.        waitfor "correct" 2
  2271.         transmit "Y^M"                 ; confirm correctness
  2272.         pause 2
  2273.         transmit "^M"
  2274.        waitfor S2 5                    ; signifies end of Forum Menu
  2275.        Join=""                         ; clear the join request
  2276.     endif
  2277. ; now perform desired task
  2278. DoTask:
  2279.     substr TempS Order2 0 3
  2280.     switch TempS
  2281.        case "mes"
  2282.           transmit "MES^M"             ; go to Message Menu
  2283.           waitfor S3 5
  2284.           substr TempS Order3 0 3
  2285.           switch TempS
  2286.              case "DEL"
  2287.                 transmit Order3
  2288.                 transmit Order4
  2289.                 transmit "^M"
  2290.                 waitfor "N)?"
  2291.                 transmit "Y^M"
  2292.              endcase
  2293.              case "REA"
  2294.                 Count=0
  2295.                 when target 2 "#: " Call ChgCount
  2296.                 pause 1
  2297.                 transmit Order3             ; this is REA ???
  2298.                 strcmp Order4 $NULLSTR
  2299.                 if not success
  2300.                    transmit Order4          ; this is message number
  2301.                 endif
  2302.                 Char=S3
  2303.                 Call CheckEnd               ; includes TRANSMIT "^M"
  2304.                 clearwhen Target 2
  2305.                 add MesgRecd Count MesgRecd
  2306.                 goto ForRunOut
  2307.              endcase
  2308.              case "ROO"
  2309.                 transmit "OPT;PAU ALW;S^M"  ; indicate to pause after message
  2310.                 waitfor S2 5
  2311.                 transmit "REA NUM:"         ; read message
  2312.                 transmit Order4             ; number for which to find root
  2313.                 transmit "^M"
  2314.                 waitfor "Action" 20
  2315.                 transmit "ROO^M"
  2316.                 waitfor "#: " 5             ; wait for start of Root message number
  2317.                 rget TempS 6                ; get Root message number - 6 digits
  2318.                 waitfor "Action" 20
  2319.                 transmit "B^M"              ; return to Read Menu
  2320.                 waitfor S1 20               ; waiting for end of Read Menu
  2321.                 transmit "OPT;PAU NEV;S^M"
  2322.                 waitfor S1 20               ; waiting for end of Read Menu
  2323.                 Count=0
  2324.                 when target 2 "#: " CALL ChgCount
  2325.                 transmit "REA THR NUM:"
  2326.                 transmit TempS              ; this is Root message of thread
  2327.                 Char=S3
  2328.                 Call CheckEnd               ; includes TRANSMIT "^M"
  2329.                 clearwhen Target 2
  2330.                 add MesgRecd Count MesgRecd
  2331.                 goto ForRunOut
  2332.              endcase
  2333.              case "Sen"
  2334.                 Count=0
  2335.                 transmit "OPT;EDI EDI;S^M"
  2336.                 waitfor S1 15               ; at end of Messages menu
  2337.                 capture off
  2338.                 set capture mode append visual
  2339.                 capture on
  2340.                 TempS=LogDir
  2341.                 strcat TempS "\MESSAGES."
  2342.                 substr Char Order1 7 3
  2343.                 strcat TempS Char
  2344.                 pause 1
  2345.                 sendfile ASCII TempS
  2346.                 while $TXCOUNT
  2347.                 endwhile
  2348.                 waitfor S1
  2349.                 capture off
  2350.                 set capture mode append filtered
  2351.                 capture on
  2352.                 fopen 0 TempS READWRITE TEXT
  2353.                 while not feof 0
  2354.                    fgets 0 Char
  2355.                    strcmp Char "/POST" 5
  2356.                    if success
  2357.                       Call ChgCount
  2358.                    endif
  2359.                 endwhile
  2360.                 fwrite 0 "          **********  SENT  **********" 38
  2361.                 fclose 0
  2362.                 add MesgSent Count MesgSent
  2363.                 goto ForRunOut
  2364.              endcase
  2365.           endswitch
  2366.        endcase
  2367.        case "lib"
  2368.           transmit "LIB 1^M"
  2369. ; determine title of Lib 1
  2370.           comgets WordS 30 5
  2371.           strlen WordS I8
  2372.           sub I8 10 I7
  2373.           substr SaveS WordS I7 8
  2374.           substr TempS Order3 0 3
  2375.           switch TempS
  2376.              case "DOW"
  2377.                 Call DnLoad
  2378.                 goto ForRunOut         ;     and leave CompuServe
  2379.              endcase
  2380.              case "UPL"
  2381.                 Call UpLoad
  2382.                 goto ForRunOut         ;     and leave CompuServe
  2383.              endcase
  2384.              case "BRO"
  2385.                 transmit Order3
  2386.                 transmit Order4        ; Lib numbers to cover
  2387.                 transmit "^M"
  2388.                 Order3="Manual mode"
  2389.                 Call ExitWait
  2390.                 goto ForRunOut         ;     and leave CompuServe
  2391.              endcase
  2392.              case "Man"
  2393.                 Call ExitWait
  2394.                 goto ForRunOut
  2395.              endcase
  2396.              default
  2397.                 transmit "SET PAGE OFF^M"
  2398.                 waitfor S4 5           ; this is " !"
  2399.                 transmit Order3        ; defines how many days to go back
  2400.                 transmit Order4        ; Lib numbers to cover & keywords
  2401.                 Char = SaveS           ; SaveS defined at entrance to Lib 1
  2402.                 Call CheckEnd          ; includes TRANSMIT "^M"
  2403.                 goto ForRunOut         ;     and leave CompuServe
  2404.              endcase
  2405.           endswitch
  2406.        endcase
  2407.     endswitch
  2408. ForRunOut:
  2409. ENDPROC ;ForumRun
  2410.  
  2411. PROC GetWaiting
  2412.     when target 2 "#: " Call ChgCount
  2413.     if eq Cfg13 1
  2414.        transmit "OPT;MOD COM;S^M"      ; this is sent in ans to "Press <CR> !"
  2415.     else
  2416.        transmit "OPT;MOD MEN;S^M"      ; this is sent in ans to "Press <CR> !"
  2417.     endif
  2418.     waitfor S2 2                       ; signifies return from Options
  2419.     transmit "MES;REA WAIT;S"          ; returns to Messages Menu
  2420.     Char=S3                            ; signifies end of Messages Menu
  2421.     Call CheckEnd                      ; includes TRANSMIT "^M"
  2422.     transmit "B^M"                     ; back up to Forum Menu
  2423.     waitfor S2                         ; signifies end of Forum Menu
  2424.     clearwhen Target 1
  2425.     clearwhen Target 2
  2426.     add MesgRecd Count MesgRecd
  2427. ENDPROC ;GetWaiting
  2428.  
  2429. PROC ChgCount
  2430.    inc Count
  2431. ENDPROC ;ChgCount
  2432.  
  2433. ;  --------------------------------------------------------------
  2434. ; |    PROCEDURES  FOR  ZIFF Net  OPERATIONS  ON  COMPUSERVE     |
  2435. ;  --------------------------------------------------------------
  2436.  
  2437. PROC SoftRun
  2438.     Count=0
  2439.     waitfor "Library" 60               ; may take long time entering Ziff Net
  2440.     strcmp Order2 "4"                  ; this is download a utility
  2441.     if success
  2442.        DesFile=FileDir
  2443.        strcat DesFile "\FileDOW.SOF"
  2444.        fopen 0 DesFile READ TEXT
  2445.        Call GetParam                   ; get filename if it's a download
  2446.     endif
  2447. DoSoftGo:
  2448.     waitfor "choice !" 3
  2449.     transmit Order2
  2450.     transmit "^M"
  2451.     strcmp Order4 "Manual mode"
  2452.     if success
  2453.        Call ExitWait
  2454.        goto DoSoftOut
  2455.     endif
  2456.     switch Order2
  2457.        case "3"                        ; search
  2458.           waitfor ":" 1
  2459.           transmit Order3              ; this is type of search
  2460.           transmit "^M"
  2461.           WAITFOR "choice" 1
  2462.           when target 1 "more !" Call TransCR
  2463.           when target 2 "Last page" CALL ClrFlag    ; sets Flag to zero
  2464.           Flag=1
  2465.           transmit Order4              ; this is keyword, file name, etc.
  2466.           transmit "^M"
  2467.           while Flag
  2468.           endwhile
  2469.           clearwhen target 1
  2470.           clearwhen target 2
  2471.        endcase
  2472.        case "4"                        ; download file(s)
  2473.           waitfor ") :" 10
  2474.           transmit TempS
  2475.           transmit "^M"
  2476.           waitfor "(Y/N):" 10
  2477.           transmit "Y^M"
  2478.           waitfor "minutes" 3
  2479.           transmit "^M"
  2480.           waitfor "choice !" 3
  2481.           transmit "2^M"
  2482.           MSPAUSE 500
  2483.           GETFILE CISB
  2484.           waitfor "page !" 15
  2485.           inc Count
  2486.           Call GetParam
  2487.           strcmp TempS "END" 3         ; check for end of data
  2488.           if not success
  2489.              transmit Order1           ; this returns to initial menu
  2490.              transmit "^M"
  2491.              GOTO DoSoftGo
  2492.           endif
  2493.           fclose 0
  2494.           add FileRecd Count FileRecd
  2495.        endcase
  2496.        default                         ; about library & instructions
  2497.           when target 1 "more !" Call TransCR
  2498.           when target 2 "Last page !" Call ClrFlag
  2499.           Flag=1
  2500.           while Flag
  2501.           endwhile
  2502.           clearwhen Target 1
  2503.           clearwhen Target 2
  2504.        endcase
  2505.     endswitch
  2506. DoSoftOut:
  2507. ENDPROC  ;SoftRun
  2508.  
  2509. ;  ------------------------------------
  2510. ; |    FILE  TRANSFER   PROCEDURES     |
  2511. ;  ------------------------------------
  2512.  
  2513. PROC DnLoad
  2514.    Count=0                             ; S4=" !" has occurred
  2515.    when target 1 "Press <CR>" call TransCR
  2516.    DesFile=FileDir
  2517.    strcat DesFile "\FileDOW."
  2518.    substr TempS Order1 7 3             ; get first 3 letters of Forum name
  2519.    strcat DesFile TempS
  2520.    fopen 0 DesFile READ TEXT
  2521. StartDL:
  2522.    WordS = "LIB "
  2523.    Call GetParam
  2524.    strcmp TempS "END" 3                ; check for end of data
  2525.    if success
  2526.       goto EndDL
  2527.    endif
  2528.    strcat WordS TempS                  ; WordS now is "LIB #"
  2529.    transmit WordS                      ; indicate which Lib to go to
  2530.    transmit "^M"
  2531.    waitfor " !" 5                      ; have to wait for next menu
  2532.    transmit "DOW PRO:B "
  2533.    Call GetParam
  2534.    strcmp TempS "END" 3                ; check for end of data
  2535.    if success
  2536.       goto EndDL
  2537.    endif
  2538.    Name = TempS
  2539.    transmit Name
  2540.    transmit "^M"
  2541. ; see if file exists
  2542.    waitfor "Not found" 5
  2543.    if success
  2544.       goto StartDL
  2545.    else
  2546. ; perform the actual download          ; next prompt would be "computer:"
  2547.       set autodnld ON
  2548.       set terminal enquiry CISB        ; set for automatic cisb download
  2549.       transmit FileDir                 ; download directory
  2550.       transmit "\"
  2551.       transmit Name                    ; use same filename as source
  2552.       transmit "^M"                    ; send it
  2553.       Call DoTransfer
  2554.       set autodnld OFF
  2555.       set terminal enquiry OFF         ; set for automatic download off
  2556.    endif
  2557.    waitfor " !" 3
  2558.    goto StartDL
  2559. EndDL:
  2560.    clearwhen target 1
  2561.    add FileRecd Count FileRecd
  2562. ENDPROC ;DnLoad
  2563.  
  2564. PROC UpLoad
  2565.    Count = 0
  2566.    when target 1 "Press <CR>" call TransCR
  2567.    DesFile=FileDir
  2568.    strcat DesFile "\FileUPL."
  2569.    substr TempS Order1 7 3             ; get first 3 letters of Forum name
  2570.    strcat DesFile TempS
  2571.    fopen 0 DesFile READ TEXT
  2572. StartUL:
  2573.    pause 1
  2574.    WordS = "LIB "
  2575.    Call GetParam                       ; returns data in TempS
  2576.    strcmp TempS "END" 3                ; check for end of data
  2577.    if success
  2578.       goto EndUL
  2579.    endif
  2580.    strcat WordS TempS                  ; WordS now is "LIB #"
  2581.    transmit WordS                      ; indicate which Lib to go to
  2582.    transmit "^M"
  2583.    waitfor "!" 15
  2584.    Call GetParam
  2585.    strcmp TempS "END"                  ; check for end of data
  2586.    if success
  2587.       goto EndUL
  2588.    endif
  2589.    transmit "UPL PRO:B TYPE:"          ; request Upload using CIS B+ protocol
  2590.    transmit TempS                      ; this is ASC, BIN, etc
  2591.    transmit "^M"
  2592.    waitfor "name:" 15
  2593.    Call GetParam
  2594.    Name=TempS                          ; this is filename
  2595.    transmit Name                       ; send filename for CIS
  2596.    transmit "^M"                       ; finalize UPL or Protocol command
  2597. DoUL:
  2598.    waitfor "computer:" 5
  2599.    set terminal enquiry CISB           ; set for automatic upload on
  2600.    if success
  2601.       clearwhen Target 0               ; to avoid "%" about file already exists
  2602.       transmit FileDir                 ; send directory for your computer
  2603.       transmit "\"
  2604.       transmit Name                    ; send filename for your computer
  2605.       transmit "^M"
  2606.    else                                ; in case "Replace it" is prompt
  2607.       transmit "Y^M"                   ; indicate replacement is desired
  2608.       goto DoUL
  2609.    endif
  2610.    waitfor "" 5
  2611.    while $FILEXFER == 0
  2612.    endwhile
  2613.    Call DoTransfer
  2614.    set terminal enquiry OFF
  2615.    if eq Item 3
  2616.       goto FinUL
  2617.    endif
  2618.    waitfor "Description" 10
  2619.    while 1
  2620.       for I6 = 1 upto 8
  2621.          Call GetParam
  2622.          transmit TempS
  2623.          strcmp TempS "/EXIT" 5
  2624.          if success
  2625.             exitwhile
  2626.          else
  2627.             transmit "^M"
  2628.          endif
  2629.       endfor
  2630.    endwhile
  2631.    transmit "^M"
  2632.    waitfor "Keywords" 10
  2633.    pause 2
  2634.    while 1
  2635.       Call GetParam
  2636.       strcmp TempS "OK"
  2637.       if not success                   ; if original or replacement
  2638.          transmit TempS
  2639.       endif
  2640.       transmit "^M"                    ; sends keyword or says none needed
  2641.       exitwhile
  2642.    endwhile
  2643.    waitfor "Title" 10
  2644.    pause 2
  2645.    while 1
  2646.       Call GetParam
  2647.       strcmp TempS "OK"
  2648.       if not success                      ; if original or replacement
  2649.          transmit TempS
  2650.       endif
  2651.       transmit "^M"                       ; sends title or says none needed
  2652.       exitwhile
  2653.    endwhile
  2654.    waitfor "(Y or N)?" 10
  2655.     transmit "Y^M"                     ; indicates correct
  2656. FinUL:
  2657.    when Target 0 "% Invalid" CALL GoManual   ; reactivate non MNP safeguard
  2658.    if eq KeepOn 1                     ; if multiple files
  2659.       goto StartUL                    ; return to send next file
  2660.    endif
  2661. EndUL:
  2662.    fclose 0
  2663.    clearwhen target 1
  2664.    add FileSent Count FileSent
  2665. ENDPROC ;UpLoad
  2666.  
  2667. PROC GetParam
  2668.    FGETS 0 Char
  2669.    STRLEN Char I8
  2670.    SUBSTR TempS Char 0 I8
  2671. ENDPROC ;GetParam
  2672.  
  2673. PROC DoTransfer
  2674.    Item=$FILEXFER
  2675.    while Item < 2
  2676.       Item=$FILEXFER
  2677.    endwhile
  2678.    switch Item
  2679.       case 2
  2680.          inc Count
  2681.       endcase
  2682.       case 3
  2683.          dialogbox 200 70 120 18 14 "FILE TRANSFER STATUS"
  2684.           text 10 4 100 10 center "FILE TRANSFER FAILURE !"
  2685.          enddialog
  2686.          alarm 1                       ; alarm for failed download
  2687.          pause 2
  2688.          destroydlg
  2689.       endcase
  2690.    endswitch
  2691. ENDPROC ;DoTransfer
  2692.  
  2693. PROC TransCR
  2694.    transmit "^M"
  2695. ENDPROC ;TransCR
  2696.  
  2697. ;  ----------------------------------------------
  2698. ; |    PROCEDURES  FOR  ENTERING  COMPUSERVE     |
  2699. ;  ----------------------------------------------
  2700.  
  2701. PROC LogOn
  2702.    Long Rate                           ; define Rate as Long number
  2703.    while $TXCOUNT                      ; characters remaining to transmit
  2704.    endwhile
  2705.    Call DefineLog                      ; define capture log name
  2706.    set capture path Cfg10
  2707.    set capture file LogName
  2708.    set capture mode append FILTERED
  2709.    set capture query off               ; DO NOT prompt for filename
  2710.    if $FROMDDIR
  2711.       Call StartLog                    ; write header in capture log
  2712.       capture ON                       ; open file LogName
  2713.       goto CheckEC
  2714.    endif
  2715.    set terminal type 5
  2716.    set terminal stripbit8 ON           ; strip the eighth bit
  2717.    set protocol CISB
  2718.    set port parity NONE
  2719.    set port databits 8
  2720.    set port stopbits 1
  2721.    set port duplex FULL
  2722.    set port dropdtr YES
  2723. ; convert Baud rate string to long number
  2724.    strlen Cfg4 I8
  2725.    sub I8 2 I8
  2726.    strcpy TempS Cfg4 I8
  2727.    ATOI TempS I6
  2728.    Rate=I6
  2729.    mul Rate 100 Rate
  2730.    set baudrate Rate                   ; Configure line settings
  2731.    I6=5                               ; number of redial attempts
  2732.    clear
  2733.    if eq Cfg16 1                       ; request for delayed dialing
  2734.       Call Delay
  2735.       if Flag
  2736.          goto End
  2737.       endif
  2738.    else
  2739.       if eq Cfg13 0
  2740.          goto ReTry
  2741.       else
  2742.          sdlgmsgbox "CALL INITIATION" "Continue to place call ?" QUESTION YESNO I7 2 BEEP
  2743.       endif
  2744.       switch I7
  2745.          case 6                        ; this is yes
  2746.             exitswitch
  2747.          endcase
  2748.          case 7                        ; this is no
  2749.             goto End                   ; discontinue LogOn by leaving procedure
  2750.          endcase
  2751.       endswitch
  2752.    endif
  2753. Retry:
  2754.    time S8                             ; Store current time in S8
  2755.    date S9                             ; Store current date in S9
  2756.    strfmt TempS " Dialing CompuServe at %s on %s from terminal" S8 S9
  2757.    pwtitlebar TempS
  2758.    Call StartLog                       ; write header in capture log
  2759. ; dial the number
  2760.    txflush
  2761.    pause 1
  2762.    Flag=0
  2763.    when target 0 "NO CARRIER" call ChgFlag    ; sets Flag = 2
  2764.    when target 1 "BUSY" call SetFlag          ; sets Flag = 1
  2765.    transmit "ATDT "                    ; dial the number
  2766.    transmit Cfg1
  2767.    transmit "^M^J"                     ; carriage return and line feed
  2768.    while $DIALING
  2769.    endwhile
  2770.    pause 8                             ; needed to wait for answer
  2771.    if eq Flag 1                        ; indicates BUSY signal
  2772.       goto badlogon
  2773.    endif
  2774.    capture ON                          ; open file LogName
  2775. ; confirm Reliable connection
  2776. CheckEC:
  2777.    strcmp Cfg5 $NULLSTR                ; if no error conformation expected
  2778.    if success                          ;(non error-correcting modem or no Cfg5)
  2779.       while ! $CARRIER
  2780.       endwhile
  2781.       alarm 2                          ; sound when carrier achieved
  2782.       goto AfterDial
  2783.    else
  2784.       when target 1 Cfg5 call SetFlag    ; sets Flag = 1  BUSY no longer needed
  2785.       when target 2 "COL: NONE" call ChgFlag  ; sets Flag = 2
  2786.       Flag=0
  2787.       Count=0                        ; when target 0 "NO CARRIER" still active
  2788.       while Flag==0
  2789.          pause 1
  2790.          inc Count
  2791.          if eq Count 35
  2792.             Flag=2                     ; means time out
  2793.             exitwhile
  2794.          endif
  2795.       endwhile
  2796.       clearwhen Target 0
  2797.       clearwhen Target 1
  2798.       clearwhen Target 2
  2799.       pause 1
  2800.       if eq Flag 2                     ; means either time out or no Protocol
  2801.          goto badlogon
  2802.       else
  2803.          alarm 1                       ; indicate successful connection
  2804.       endif
  2805.    endif
  2806. AfterDial:                             ; come here from dialing directory
  2807.    if $CARRIER
  2808.       KeepOn = 1
  2809.    else
  2810.       goto badlogon
  2811.    endif
  2812. ; script for logging onto CIS
  2813.    while $CARRIER
  2814.       transmit "^M"                    ; initiate logging on CIS
  2815.       waitfor "Host Name:"
  2816.       if success
  2817.          transmit "CIS^M"
  2818.       else
  2819.          goto badlogon
  2820.       endif
  2821.       waitfor "User ID:"
  2822.       if success
  2823.          transmit Cfg2
  2824.          transmit "^M"
  2825.       else
  2826.          goto badlogon
  2827.       endif
  2828.       waitfor "Password:"
  2829.       if success
  2830.          transmit Cfg3                 ; send password, transmit "^M" is below
  2831.       else
  2832.          goto badlogon
  2833.       endif
  2834.       L1=$ltime                     ; Start time for lapsed time calculation
  2835.       set terminal stripbit8 OFF       ; stop striping the eighth bit
  2836.       when Target 0 "% Invalid" CALL GoManual   ; protection against "bad" commands
  2837.       when cdchanges CALL LostCD
  2838.       when Target 2 "Mail wait" CALL PickUpMail ; to catch mail waiting message
  2839.       transmit "^M"                    ; Send <CR> for Password transmission
  2840.       waitfor "Reserved" 60            ; end of CompuServe banner
  2841.       pwtitlebar "On line to CompuServe"
  2842.       waitfor "Enter choice"  10       ; choice request at end of Top Menu
  2843.                                        ; mail pickup will occur here ----
  2844.       clearwhen Target 2               ; no more chance for mail message-close
  2845.       goto End
  2846.    endwhile
  2847.  
  2848. BadLogon:
  2849.    hangup
  2850.    capture OFF
  2851.    KeepOn = 0
  2852.    while I6 > 0                       ; for count variable positive,
  2853.       dec I6                          ;          decrement the counter and
  2854.       pwtitlebar "Pausing before redialing"
  2855.       pause 15                         ; wait 10 seconds before redial before
  2856.       goto Retry                       ;       going back to redial
  2857.    endwhile
  2858.    set terminal stripbit8 OFF          ; stop striping the eighth bit
  2859.    pwtitlebar CISTitle
  2860.    UserMsg "Log on aborted"
  2861. End:
  2862. ENDPROC ;LogOn
  2863.  
  2864. PROC SetFlag
  2865.    Flag=1
  2866. ENDPROC ;SetFlag
  2867.  
  2868. PROC ChgFlag
  2869.    Flag=2
  2870. ENDPROC  ;ChgFlag
  2871.  
  2872. PROC DefineLog
  2873.    Date Today
  2874.    SubStr Month Today 0 2
  2875.    SubStr Day Today 3 2
  2876.    LogName="CIS_"
  2877.    StrCat LogName Month 2
  2878.    StrCat logName Day 2
  2879.    StrCat LogName ".CAP" 4
  2880. ENDPROC ;DefineLog
  2881.  
  2882. PROC StartLog
  2883.    LogLoc=LogDir
  2884.    strcat LogLoc "\"
  2885.    strcat LogLoc LogName
  2886.    IsFile LogLoc
  2887.    If Success
  2888.        FOpen 1 LogLoc WRITE TEXT       ; open Capture Log for appending
  2889.        FSeek 1 0 2
  2890.    Else
  2891.        FOpen 1 LogLoc CREATE TEXT      ; open Capture Log for first write
  2892.    EndIf
  2893.    Fputc 1 10                          ; sends line feed to file
  2894.    strfmt TempS ">>>> CISPlus Capture Log Opened on %s at %s <<<<" $Date $Time
  2895.    fputs 1 TempS
  2896.    FClose 1                            ; close Capture Log after heading write
  2897. ENDPROC ;StartLog
  2898.  
  2899. PROC Delay
  2900. StartDelay:
  2901.    substr TempS $TIME24 0 5
  2902.    strfmt SaveS "DIALING WILL BEGIN AT %s" Begin
  2903.    strfmt WordS "PRESENT TIME IS %s" TempS
  2904.    dialogbox 115 90 130 50 14 "SUSPENDED DIALING"
  2905.     vtext 10 5 110 8 center SaveS
  2906.     vtext 10 15 110 8 center WordS
  2907.     pushbutton  5 30 40 15 "&New Time" normal default
  2908.     pushbutton 50 30 40 15 "No &Delay" normal
  2909.     pushbutton 95 30 30 15 "&Abort" normal
  2910.    enddialog
  2911.    Flag = 1
  2912.    while Flag
  2913.       S1=$TIME24                       ; continually get current Military time
  2914.       strcmp S1 TempS 5                ; compare current HH:MM to suspend time
  2915.       if failure                       ; if not
  2916.          substr TempS S1 0 5           ; get HH:MM portion of current time
  2917.          strfmt WordS "PRESENT TIME IS %s" TempS
  2918.          updatedlg 64                  ; update the dialog box display
  2919.       endif
  2920.       strcmp TempS Begin               ; compare current HH:MM to suspend time
  2921.       if success                       ; when they are the same
  2922.          Flag = 0                      ;               exit the WHILE
  2923.          exitwhile
  2924.       endif
  2925. ; check for dialog box input
  2926.       choice=$DIALOG
  2927.       switch choice
  2928.          case 10
  2929.             sdlginput "SUSPEND TIME DEFINITION" "Enter military time in HH:MM format:" Begin
  2930.             call SaveCfg
  2931.             goto StartDelay
  2932.          endcase
  2933.          case 11
  2934.             Flag = 0                   ;               exit the WHILE
  2935.             exitwhile
  2936.          endcase
  2937.          case 12
  2938.             exitwhile                  ; leaves Flag = 1
  2939.          endcase
  2940.       endswitch
  2941. ; loop to get new time value
  2942.    endwhile
  2943.    destroydlg
  2944. ENDPROC ;Delay
  2945.  
  2946. PROC PickUpMail
  2947.     clearwhen Target 2                 ; close WHEN before "Mail" occurs again
  2948.     strcmp Order1 "GO CIS:MAIL"
  2949.     if success
  2950.        strcmp Order3 "Get Mail"
  2951.        if success
  2952.           goto PickUpEnd
  2953.        endif
  2954.     endif
  2955.     if eq Cfg15 1                      ; indicates confirm mail pickup
  2956.        sdlgmsgbox "AUTOMATIC MAIL PICKUP" "MAIL WAITING !,Download Mail Now ?" \
  2957.           QUESTION YESNO choice BEEP
  2958.        if eq choice 7                  ; this is No (6 is Yes)
  2959.           goto PickUpEnd
  2960.        endif
  2961.     endif
  2962.     SaveS=Order3
  2963.     Order3="Get Mail"
  2964.     transmit "GO CIS:MAIL^M"
  2965.     Call MailRun
  2966.     Order3=SaveS
  2967.     SaveS=$NULLSTR
  2968. PickUpEnd:
  2969. ENDPROC ;PickUpMail
  2970.  
  2971. ;  ---------------------------------------------
  2972. ; |    PROCEDURES  FOR  LEAVING  COMPUSERVE     |
  2973. ;  ---------------------------------------------
  2974.  
  2975. PROC CheckEnd                          ; suggested by Markus Pope of DATASTORM
  2976.    Flag=1
  2977.    when TARGET 1 Char  CALL ClrFlag    ; WHEN 2 is counting messages
  2978.  
  2979.    transmit "^M"
  2980.    while Flag
  2981.       if eq KeepOn 0
  2982.          exitwhile
  2983.       endif
  2984.    endwhile
  2985.    clearwhen Target 1
  2986. ENDPROC ;CheckEnd
  2987.  
  2988. PROC ClrFlag
  2989.    Flag=0
  2990. ENDPROC ;ClrFlag
  2991.  
  2992. PROC LostCD
  2993.    dialogbox 250 150 70 18 14 "CD INTERRUPT"
  2994.     text 10 4 50 8 center "Carrier lost"
  2995.    enddialog
  2996.    for I6=1 upto 5
  2997.       if $CARRIER
  2998.          goto LostCDOut
  2999.       endif
  3000.       mspause 500
  3001.    endfor
  3002.    KeepOn = 0
  3003.    Call ExitCIS
  3004. LostCDOut:
  3005.    destroydlg
  3006. ENDPROC ;LostCD
  3007.  
  3008. PROC GoManual
  3009.    sdlgmsgbox "INVALID COMMAND PROBLEM" "Enter Commands Manually" EXCLAMATION OK choice
  3010.    CALL ExitWait                       ; wait for LOG command
  3011. ENDPROC ;GoManual
  3012.  
  3013. PROC LogOff
  3014.    waitfor "!" 2
  3015.    transmit "LOG^M"
  3016.    Call ExitWait
  3017. ENDPROC ;LogOff
  3018.  
  3019. PROC ExitWait
  3020.    waitfor "User ID:" FOREVER
  3021.    Call ExitCIS
  3022. ENDPROC ;ExitWait
  3023.  
  3024. PROC ExitCIS
  3025.    clearwhen Target 0
  3026.    clearwhen Target 1
  3027.    clearwhen Target 2
  3028.    clearwhen cdchanges                 ; discontinue check for disconnect
  3029.    pause 1                             ;       wait for completion of hang up
  3030.    if $CARRIER
  3031.       hangup                           ;    then hang up the modem
  3032.    endif
  3033.    pause 1                             ;       wait for completion of hang up
  3034.    Capture OFF                         ;         and close the log
  3035.    KeepOn = 0
  3036.    Call Lapsed
  3037.    FOpen 1 LogLoc WRITE TEXT           ; open Capture Log for appending
  3038.    FSeek 1 0 2                         ; locate end of file
  3039.    FStrFmt 1 "%cTotal CompuServe connect time was %s%c*****%c" 10 ETime 10 10
  3040.    FClose 1
  3041. ENDPROC ;ExitCIS
  3042.  
  3043. PROC Lapsed
  3044.    Long Final
  3045.    Integer Delta, eminsub, ehours, eminutes, eseconds
  3046.    String fhours, fminutes, fseconds
  3047.    Final = $ltime                      ; Here starts the loop which calculates
  3048.    Delta = Final - L1               ; total elapsed seconds
  3049.    div Delta 3600 ehours               ; convert on-line time back
  3050.    mod Delta 3600 eminsub              ; to hrs. min. secs.
  3051.    div eminsub 60 eminutes             ; (Divide total by 3600 for
  3052.    mod eminsub 60 eseconds             ; hours; get REMAINDER;
  3053.    itoa ehours fhours                  ; divide remainder by 60
  3054.    itoa eminutes fminutes              ; to get minutes, etc.)
  3055.    itoa eseconds fseconds              ; Integers back to strings
  3056.    strfmt ETime " %s:%02s:%02s " fhours fminutes fseconds ; Final display param
  3057. ENDPROC ;Lapsed
  3058. ; ========================  END  OF  SCRIPT  ===========================
  3059.  
  3060. ;                     HISTORY of CHANGES to AUTOCIS
  3061. ;                     ═════════════════════════════
  3062.  
  3063. ; Initial Version    release  5 November 1992
  3064.  
  3065. ; Version 1.01       released  10 December 1992
  3066. ;
  3067. ;         * removed duplicate no paging command in ForumRun.
  3068. ;         * provided immediate updating of Setup menus when data is changed
  3069. ;              by user input.
  3070. ;         * added "press <CR> for all" to Library Age request in Forum.
  3071. ;         * provided for adding directory to filename if not included when
  3072. ;              invoking the editor.
  3073. ;         * changed when target in logon procedure to avoid aborting due
  3074. ;              to Compression "NONE" rather than Protocol "NONE".
  3075. ;         * provided for retaining Delayed Dialing time in AUTOCIS.CFG
  3076. ;              and redefining value when delay starts.
  3077. ;         * incorporated additional information in AUTOCIS.DOC regarding
  3078. ;              the use of Delayed Dialing.
  3079. ;         * changed capture mode to "visual" during FASTDOC uploads to clean
  3080. ;              up the capture log.
  3081. ;         * Altered accquiring the filename in Mail Binary download to avoid
  3082. ;              being "fooled" by periods in sender's name.
  3083. ;         * provided when command to handle "Press CR" after uploads/downloads
  3084. ;              when using Manual Mode of script.
  3085. ;         * added character activation to pushbuttons not already provided
  3086.  
  3087.